Re: [Tutor] omnicomplete vim python

2006-08-29 Thread Alan Gauld
>i want some form of suggestion or autocompletion
> so if i say
> import aspell
> and then type
> aspell.
> i know what are available without running to pyshell or some 
> interpreter
> and aspell.Dict(
> should suggest wat are the possible arguments

This isn't answering Anil's question but I'm curious.
I've had access to editors that do this kind of thing since 1988
when I first encountered DECs LSE(Language Sensitive Editor)
for the VAX. and in a more limited form C and Lisp modes on emacs.
Then it became popular on PC editors in Visual Studio and
the Borland tools.

But does anyone actually use this feature? I know I don't, in
fact I usually turn it off because I find it distracting! I usually
know what attributes or methods I need to call, and the
parameters that I need to pass often depend on context anyway
so the tools often get it wrong.

So I'm curious, how many folks actively use these so-called
productivity features like intellisense/omnicomplete?

BTW I don't mind toopltips - where they tell you the signature
of a function but don't fill it in... Its the autocomplete feature 
I've
never found helpful.

Alan G


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How would I make a program that password protects on aninactivity timer?

2006-08-29 Thread Alan Gauld
> (This is on Windows, on something called novell, 
> or something close which acts as a logon service)

Hmm, Novell, the second biggest networking company in the 
world might not be too pleased with that description... :-)

Novell provides a comprehensive network resource 
and inventory management service as well as a directory 
service and shared storage and alarm management. 
If you are not on Win2K or XP its probably pretty 
fundamental to your entire network operation.

It also provides logon services including such features as
password history protection, password timeouts, 
password composition rules etc. But it primarily 
operates at the network level, it will prevent you 
accessing the network rather than the PC (although 
it can do the latter if you have the appropriate client 
installed).


> I noticed that there's no way to activate password 
> protection on inactivity, or no way to secure the 
> computer at all without logging off 

This will depend on the OS. If it is Windows NT, 
Win 2000 or XP you can do a lot of this from 
Windows. On older Windows versions the protection 
is still there but not as strong. Simply activate 
the Screen saver and set up a password.

> creating a program, that ran a timer that reset 
> when you move the mouse or hit a key, 

This is possible by detecting Windows events 
and resetting the time, but its not that easy and 
not really necessary. Windows provides all the 
protection you should need.

> I have a basic understanding of python...mostly 
> what I need to know is how to freeze and 
> unfreeze the processes, and bring the 
> program to the top. 

You shouldn't freeze processes but you do want to 
bar access to them, typically by forcing your program 
to the front and swallowing all the usual bypass 
mechanisms such as Ctrl-Alt-Del, Alt-Tab etc.

> Also, If there is a way to turn off/restart the computer, 
> or log off (of novell) I'd appreciate it if you could tell me.

Search MSDN for that one, there is a way but I confess 
I've forgotten how!

> If this is not possible, is there any way to end/restart 
> the explorer.exe program? 

Thats possible too but not recommended, you mess up 
all the users session settings!

I'd try the screen saver settings first, its much easier!

Alan G.

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] interested in python

2006-08-29 Thread Alan Gauld
Hi Conrad,

Welcome to the tutor list.

>I am just wondering if I would be able to hire a tutor to learn 
>Python or

We come free.

> not, I know there is a tutorial, but I dont seem to be learning 
> throught
> tuturials,

OK, The way this list works is you pick one (or more!) tutorials
and try to work through them. When you hit something you
don't understand you ask a question on the list and  whoever
thinks they know the answer will send a reply.

The questions can be specific to code:

"here's what I wrote but it doesn't work - Here is the error
message I got"
- it's very important to include the error messages!

or conceptual, eg:

"I don't understand how parameters work with functions..."

> my questions is there any tutors Online

This list operates online only

> i reside in  Canada , Ontario , Brampton.

And the internet renders that irrelevant :-)

Regards from Scotland,

Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How would I make a program that password protects on aninactivity timer?

2006-08-29 Thread R. Alan Monroe

> I'd try the screen saver settings first, its much easier!

This is not Python specific, but very informative:
http://www.codeproject.com/cpp/holsavers.asp

Alan

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] program that 'waits' for file?

2006-08-29 Thread Tim Golden
[Kay White]

| I'm trying to make a program that will wait for a specific 
| file to be made by another program, and when that happens it 
| opens and modifies that file. The other program is a 
| commercial game that allows the player to take screenshots. 
| It saves the screenshots in a particular directory, naming 
| each one "screenshot#.bmp". The # is a number that increases 
| with each new file. 

Given the ".bmp" suffix, I'm going to assume you're running
on some flavour of Windows. In that case, you might want to
make use of some form of directory-monitoring (possibly inside
a thread) which would watch the directory where the screenshots
are saved and reacts when a file is created within.

Have a look at:

http://tgolden.sc.sabren.com/python/win32_how_do_i/watch_directory_for_c
hanges.html

for a few possibilities.

TJG


This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] omnicomplete vim python

2006-08-29 Thread Mike Hansen
 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Alan Gauld
> Sent: Tuesday, August 29, 2006 1:26 AM
> To: anil maran
> Cc: tutor@python.org
> Subject: Re: [Tutor] omnicomplete vim python
> 
[...]
> 
> This isn't answering Anil's question but I'm curious.
> I've had access to editors that do this kind of thing since 1988
> when I first encountered DECs LSE(Language Sensitive Editor)
> for the VAX. and in a more limited form C and Lisp modes on emacs.
> Then it became popular on PC editors in Visual Studio and
> the Borland tools.
> 
> But does anyone actually use this feature? I know I don't, in
> fact I usually turn it off because I find it distracting! I usually
> know what attributes or methods I need to call, and the
> parameters that I need to pass often depend on context anyway
> so the tools often get it wrong.
> 
> So I'm curious, how many folks actively use these so-called
> productivity features like intellisense/omnicomplete?
> 
> BTW I don't mind toopltips - where they tell you the signature
> of a function but don't fill it in... Its the autocomplete feature 
> I've
> never found helpful.
> 
> Alan G

I switch between Komodo and VIM. Komodo has autocomplete. I've never
found it distracting. It's kind of useful. I haven't explored
omnicomplete in VIM yet. I still just ctrl-n instead of using the new
omnicomplete stuff. I like the background syntax checking in Komodo. It
has been helping me clean up problems before I get around to running
Pyflakes on the program. 

BTW, the next version of Komodo will have vi key-bindings!

Mike  
**
IMPORTANT: The contents of this email and any attachments are confidential. 
They are intended for the 
named recipient(s) only.
If you have received this email in error, please notify the system manager or 
the sender immediately and do 
not disclose the contents to anyone or make copies thereof.
*** eSafe scanned this email for viruses, vandals, and malicious content. ***
**

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How would I make a program that password protects on an inactivity timer?

2006-08-29 Thread Kent Johnson
[EMAIL PROTECTED] wrote:
>  If this is not possible, is there any way to end/restart the explorer.exe 
> program? If not, is there any other way you would reccomend securing the 
> computer? (not a program thats downloaded, we have to prove that everything 
> we download is for educational purposes @_@)

This might be of interest:
http://tgolden.sc.sabren.com/python/win32_how_do_i/lock_my_workstation.html

Kent

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] thanks

2006-08-29 Thread Joe Gamman
just a quick note to say thanks to all the replies i got from the community.  once again, my idea has already been done, and far better than i could have imagined.  i'm off to wander aimlessly around the useless python site ;-)
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] omnicomplete vim python

2006-08-29 Thread Andrew Robert
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



Mike Hansen wrote:
>  
> 
>> -Original Message-
>> From: [EMAIL PROTECTED] 
>> [mailto:[EMAIL PROTECTED] On Behalf Of Alan Gauld
>> Sent: Tuesday, August 29, 2006 1:26 AM
>> To: anil maran
>> Cc: tutor@python.org
>> Subject: Re: [Tutor] omnicomplete vim python
>>
> [...]
>> This isn't answering Anil's question but

ditto .. but you may wish to consider the following python add-on for VIM.

http://www.vim.org/scripts/script.php?script_id=790

It includes:

Enhanced version of the original (from vim6.1) python.vim for Python
programming language.

The changes since the original python.vim are:

- - changed strings highlighting;
- - enhanced special symbols highlighting inside strings;
- - enhanced numbers highlighting;
- - added optional highlighting for %-formatting inside strings;
- - added highlighting for some error conditions (wrong symbols in source
file,
  mixing spaces and tabs, wrong number values,
  wrong %-formatting inside strings);
- - added highlighting for magic comments: source code encoding
  and #! (executable) strings;
- - added highlighting for new exceptions and builtins introduced in
python 2.3, 2.4 and 2.5;
- - added highlighting for doctests;
- - added highlighting for new @decorator syntax introduced in Python 2.4a2;
- - added highlighting for trailing-space errors (triggered by new
  option: python_highlight_space_errors);
- - added highlighting for variable name errors;
- - added highlighting for hex number errors;
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (MingW32)
Comment: GnuPT 2.7.2

iD8DBQFE9GYjDvn/4H0LjDwRAtecAJ4oWEqO5CQN0vLyFOKpRyb7PtRhSACgr9gJ
v4MQqzHAFdk8OJMHulpW9uM=
=fces
-END PGP SIGNATURE-
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] omnicomplete vim python

2006-08-29 Thread Alan Gauld
Thanks for that, it definitely improves a few things, well worth 
having.
Thanks.

And the other advantage of this thread is it let me know vim 7 is
out - yippee! :-)

Alan G.

"Andrew Robert" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
>
>
> Mike Hansen wrote:
>>
>>
>>> -Original Message-
>>> From: [EMAIL PROTECTED]
>>> [mailto:[EMAIL PROTECTED] On Behalf Of Alan Gauld
>>> Sent: Tuesday, August 29, 2006 1:26 AM
>>> To: anil maran
>>> Cc: tutor@python.org
>>> Subject: Re: [Tutor] omnicomplete vim python
>>>
>> [...]
>>> This isn't answering Anil's question but
>
> ditto .. but you may wish to consider the following python add-on 
> for VIM.
>
> http://www.vim.org/scripts/script.php?script_id=790
>
> It includes:
>
> Enhanced version of the original (from vim6.1) python.vim for Python
> programming language.
>
> The changes since the original python.vim are:
>
> - - changed strings highlighting;
> - - enhanced special symbols highlighting inside strings;
> - - enhanced numbers highlighting;
> - - added optional highlighting for %-formatting inside strings;
> - - added highlighting for some error conditions (wrong symbols in 
> source
> file,
>  mixing spaces and tabs, wrong number values,
>  wrong %-formatting inside strings);
> - - added highlighting for magic comments: source code encoding
>  and #! (executable) strings;
> - - added highlighting for new exceptions and builtins introduced in
> python 2.3, 2.4 and 2.5;
> - - added highlighting for doctests;
> - - added highlighting for new @decorator syntax introduced in 
> Python 2.4a2;
> - - added highlighting for trailing-space errors (triggered by new
>  option: python_highlight_space_errors);
> - - added highlighting for variable name errors;
> - - added highlighting for hex number errors;
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.2.1 (MingW32)
> Comment: GnuPT 2.7.2
>
> iD8DBQFE9GYjDvn/4H0LjDwRAtecAJ4oWEqO5CQN0vLyFOKpRyb7PtRhSACgr9gJ
> v4MQqzHAFdk8OJMHulpW9uM=
> =fces
> -END PGP SIGNATURE-
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
> 


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How would I make a program that password protects on aninactivity timer?

2006-08-29 Thread Bill Burns
[Alan Gauld]
> I'd try the screen saver settings first, its much easier!
> 

As Alan has stated above, the screen saver idea is probably the easiest
way to go, but personally... I always to do it the the hard way :-)

Using ideas from eariler posts (regarding Windows events and ctypes),
here's my attempt.

Warning: This is an initial start that you can fix-up and build upon.

Suggestions welcome.

Bill


"""
Locks a Windows WorkStation if a user is idle for a specific
amount of time.

My definition of idle is:
1). No keys have been pressed.
2). The mouse has not been moved.

To run this, you will need to install:
pywin32 -> http://sourceforge.net/projects/pywin32/
ctypes  -> http://sourceforge.net/projects/ctypes/
pyHook  -> http://www.cs.unc.edu/Research/assist/developer.shtml

This works for me on Windows 2000 Pro SP4 using:
Python 2.4.3
pywin32 Build 208
ctypes-0.9.6
pyHook-1.4

Things that should probably be fixed:
1). This only runs once. When we hit the limit in idleTimer(), we
break out of the loop and never go back. Ideally, it should reset /
restart when we logon again...
2). Do we need a method to stop the message pump? Right now, it
just runs indefinitely.
"""

import time
from threading import Thread
import Queue

import pythoncom
import ctypes
import win32api
import pyHook

def idleTimer(limit, queue):
 # Count how long we are idle by incrementing our
 # queue. The mouse and keyboard events will 'reset'
 # the queue to zero. If the limit is hit, we lock
 # the WorkStation.
 while True:
 idleTime = queue.get_nowait()
 print "We've been idle for %s second(s)." % (idleTime)
 if idleTime == limit:
 # Lock the WorkStation.
 ctypes.windll.user32.LockWorkStation()
 break
 queue.put(idleTime + 1)
 time.sleep(1)

def mouseEvent(event):
 # If the mouse moves, this get fired.
 if event.MessageName == 'mouse move':
 try:
 # The mouse was moved, so 'reset' the timer.
 # Note: When the mouse is moving, this function
 # gets hit 'a lot'... Initially, I was only
 # doing queue.put(0), but that just clobbered
 # the queue with zeros. To combat that, I do
 # a get() then a put(). There's gotta be a
 # better way
 queue.get_nowait()
 queue.put(0)
 # We don't want to stop these events, so we
 # need to return True. Don't change this!
 return True
 except Queue.Empty:
 # Again, don't change this!
 return True

def keyboardEvent(event):
 # Same as above except for key presses.
 if event.MessageName == 'key down':
 try:
 queue.get_nowait()
 queue.put(0)
 return True
 except Queue.Empty:
 return True

if __name__ == '__main__':
 # Set the idle limit (in seconds).
 idleLimit = 10
 # Make a queue.
 queue = Queue.Queue()
 # Put an initial value into the queue.
 queue.put(0)
 # Fire-up our idle timer.
 timer = Thread(target=idleTimer, args=(idleLimit, queue))
 timer.setDaemon(True)
 timer.start()
 # Hook both the mouse and keyboard events.
 # Create the hook manager.
 hm = pyHook.HookManager()
 # Watch for these events.
 hm.MouseAll = mouseEvent
 hm.KeyDown = keyboardEvent
 # Set the hooks.
 hm.HookMouse()
 hm.HookKeyboard()
 # Wait forever.
 pythoncom.PumpMessages()







___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How would I make a program that password protects on aninactivity timer?

2006-08-29 Thread Bill Burns
[Bill Burns]

> import pythoncom
> import ctypes
> import win32api



You can lose the win32api import in my code.

Initially, I was using `win32api.ExitWindowsEx(0, 0)` to logout, but
after Kent posted the link to ctypes.windll.user32.LockWorkStation(), I
switched to the cytpes method. I just forgot to pull the import.

Bill

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Install problems

2006-08-29 Thread Maureen OSullivan








When I tried to install Windows/x86 I got this message:  Internal
Error 2229. ,Control, SELECT ‘Control’, ‘Type’,
‘X’, ‘Y’, ‘Width’, ‘Height’,
‘Attributes’, ‘Property’, ‘Text’,
‘Control_Next’, ‘Help’ FROM ‘Control’ WHERE
‘Dialog_’=?

 

Can you tell me how to get Python to install. 

 

Thanks

Maureen






___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Unicode problems

2006-08-29 Thread Ed Singleton
I've been having unicode problems in python on Mac OS 10.4.

I googled for it and found a good page in Dive Into Python that I
thought might help
(http://www.diveintopython.org/xml_processing/unicode.html).

I tried following the instructions and set my default encoding using a
sitecustomize.py, but got the following:

>>> import sys
>>> sys.getdefaultencoding()
'utf-8'
>>> s = u'La Pe\xf1a'
>>> print s
Traceback (most recent call last):
  File "", line 1, in ?
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf1' in
position 5: ordinal not in range(128)
>>>

As I understand it, that should work.  I tried using different
character sets (like latin-1, etc), but none of them work.

The main problem  I am having is in getting python not to give an
error when it encounters a sterling currency sign (£, pound sign here
in UK), which I suspect might be some wider problem on the mac as when
I type that character in the terminal it shows a # (but in Python it
shows a £).

Any help, or hints greatly appreciated.

Thanks

Ed
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] File IO

2006-08-29 Thread Amadeo Bellotti
Ok im trying to create a file that the user chooses the name of and
print a varible that is a string to the text file. but for some reason
whne i do this code:

FILE = open(filename, "w")
FILE.write(puzzleanswers)
FILE.close()

it doesnt write anything does anyone know how to fix it  so it works?
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Unicode problems

2006-08-29 Thread Kent Johnson
Ed Singleton wrote:
> I've been having unicode problems in python on Mac OS 10.4.
>
> I googled for it and found a good page in Dive Into Python that I
> thought might help
> (http://www.diveintopython.org/xml_processing/unicode.html).
>
> I tried following the instructions and set my default encoding using a
> sitecustomize.py, but got the following:
>
>   
 import sys
 sys.getdefaultencoding()
 
> 'utf-8'
>   
 s = u'La Pe\xf1a'
 print s
 
> Traceback (most recent call last):
>   File "", line 1, in ?
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xf1' in
> position 5: ordinal not in range(128)
>   
>
> As I understand it, that should work.  I tried using different
> character sets (like latin-1, etc), but none of them work.
>   
I'm not sure Dive into Python is correct. Here is what I get on Windows:
In [1]: s = u'La Pe\xf1a'

In [2]: print s
La Peña

In [3]: import sys

In [4]: sys.getdefaultencoding()
Out[4]: 'ascii'

In [5]: sys.stdout.encoding
Out[5]: 'cp437'

I think print converts to the encoding of sys.stdout, not the default 
encoding. What is the value of sys.stdout.encoding on your machine?

Kent
> The main problem  I am having is in getting python not to give an
> error when it encounters a sterling currency sign (£, pound sign here
> in UK), which I suspect might be some wider problem on the mac as when
> I type that character in the terminal it shows a # (but in Python it
> shows a £).

Where is the pound sign coming from? What encoding is it in? What do you 
mean, in Python it shows £? You said Python gives an error...Fixing your 
first problem may not help this one without a bit more digging... (BTW 
in the US a # is sometimes called a 'pound sign', maybe the computer is 
trying to translate for you ;) - though it is for pound weight, not 
pound sterling.)

Kent

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] File IO

2006-08-29 Thread Kent Johnson
Amadeo Bellotti wrote:
> Ok im trying to create a file that the user chooses the name of and print a
> varible that is a string to the text file. but for some reason whne i do
> this code:
>
> FILE = open(filename, "w")
> FILE.write(puzzleanswers)
> FILE.close()
>
> it doesnt write anything does anyone know how to fix it  so it works?

I would
print filename
print puzzleanswers

to make sure you know what should happen.

Kent

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] File IO

2006-08-29 Thread Amadeo Bellotti
i do and they have writing but its just not printing it at allOn 8/29/06, Kent Johnson <[EMAIL PROTECTED]> wrote:
Amadeo Bellotti wrote:> Ok im trying to create a file that the user chooses the name of and print a
> varible that is a string to the text file. but for some reason whne i do> this code:>> FILE = open(filename, "w")> FILE.write(puzzleanswers)> FILE.close()>> it doesnt write anything does anyone know how to fix it  so it works?
I wouldprint filenameprint puzzleanswersto make sure you know what should happen.Kent___Tutor maillist  -  
Tutor@python.orghttp://mail.python.org/mailman/listinfo/tutor
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] File IO

2006-08-29 Thread Bob Gailer
Amadeo Bellotti wrote:
> Ok im trying to create a file that the user chooses the name of and 
> print a varible that is a string to the text file. but for some reason 
> whne i do this code:
>
> FILE = open(filename, "w")
> FILE.write(puzzleanswers)
> FILE.close()
>
> it doesnt write anything 
That could mean you get an empty file or you don't see the file. Which 
is it?
If the file is empty that means puzzleanswers is  empty.
If you don't see the file that means it is being written someplace other 
than where you are looking.

-- 
Bob Gailer
510-978-4454

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] File IO

2006-08-29 Thread Amadeo Bellotti
well i made a typo and puzzleanswers was empty i fixed it and it works fine thank you guys so muchOn 8/29/06, Bob Gailer <
[EMAIL PROTECTED]> wrote:Amadeo Bellotti wrote:> Ok im trying to create a file that the user chooses the name of and
> print a varible that is a string to the text file. but for some reason> whne i do this code:>> FILE = open(filename, "w")> FILE.write(puzzleanswers)> FILE.close()>
> it doesnt write anythingThat could mean you get an empty file or you don't see the file. Whichis it?If the file is empty that means puzzleanswers is  empty.If you don't see the file that means it is being written someplace other
than where you are looking.--Bob Gailer510-978-4454
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Install problems

2006-08-29 Thread Alan Gauld
Maureen,

> When I tried to install Windows/x86 I got this message:  Internal 
> Error
>2229. ,Control, SELECT 'Control', 'Type', 'X', 'Y', 'Width', 
>'Height',
>'Attributes', 'Property', 'Text', 'Control_Next', 'Help' FROM 
>'Control'
> WHERE 'Dialog_'=?

>Can you tell me how to get Python to install.

 What exactly did you try to install? Where did you download it from?

For a Windows install I strongly recommend the ActiveState version
over the ordinary Python.org version. Opensource purists may object
but the bonus features all built in is worth it IMHO.

But it should be as simple as running the installer after downloading 
it.

Alan G.

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] File IO

2006-08-29 Thread Alan Gauld

>i do and they have writing but its just not printing it at all
>

How do you know? Where are you looking for the file?
Are you sure its not a Path issue?

Alan G.


> On 8/29/06, Kent Johnson <[EMAIL PROTECTED]> wrote:
>>
>> Amadeo Bellotti wrote:
>> > Ok im trying to create a file that the user chooses the name of 
>> > and
>> print a
>> > varible that is a string to the text file. but for some reason 
>> > whne i do
>> > this code:
>> >
>> > FILE = open(filename, "w")
>> > FILE.write(puzzleanswers)
>> > FILE.close()
>> >
>> > it doesnt write anything does anyone know how to fix it  so it 
>> > works?
>>
>> I would
>> print filename
>> print puzzleanswers
>>
>> to make sure you know what should happen.
>>
>> Kent
>>
>> ___
>> Tutor maillist  -  Tutor@python.org
>> http://mail.python.org/mailman/listinfo/tutor
>>
> 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] File IO

2006-08-29 Thread Amadeo Bellotti
no no the file shows up in the same directory as the .py file and i no it works cause i read the text fileOn 8/29/06, Alan Gauld <
[EMAIL PROTECTED]> wrote:>i do and they have writing but its just not printing it at all
>How do you know? Where are you looking for the file?Are you sure its not a Path issue?Alan G.> On 8/29/06, Kent Johnson <[EMAIL PROTECTED]> wrote:
 Amadeo Bellotti wrote:>> > Ok im trying to create a file that the user chooses the name of>> > and>> print a>> > varible that is a string to the text file. but for some reason
>> > whne i do>> > this code:>> >>> > FILE = open(filename, "w")>> > FILE.write(puzzleanswers)>> > FILE.close()>> >>> > it doesnt write anything does anyone know how to fix it  so it
>> > works? I would>> print filename>> print puzzleanswers to make sure you know what should happen. Kent>>
>> ___>> Tutor maillist  -  Tutor@python.org>> http://mail.python.org/mailman/listinfo/tutor
>>>
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] re syntax

2006-08-29 Thread Tiago Saboga
Em Segunda 28 Agosto 2006 15:54, Kent Johnson escreveu:
> A 'space character' is the single character \x20. A 'whitespace
> character' is any character in a some set of non-printing (white)
> characters. I guess it is a subtle distinction but it's common usage,
> not just Python; it even has a Wikipedia entry:
> http://en.wikipedia.org/wiki/Whitespace_%28computer_science%29
>
> (Not to be confused with Whitespace the programming language, in which
> all *non* white space characters are ignored:
> http://en.wikipedia.org/wiki/Whitespace_programming_language :-))

Ok, you won. ;-)

Thanks.

Tiago.
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] About cholesky funtion

2006-08-29 Thread 李 建强

Hi,
In my procedure, I use the cholesky(a) function in the scipy.linalg.decomp 
model. If the max number of row and column in matrix a is less equal 15, 
cholesky(a) is OK. But when the max number is larger than 15, there will 
have a error message:
“File "C:\Python24\Lib\site-packages\scipy\linalg\decomp.py", line 413, 
in cholesky

   if info>0: raise LinAlgError, "matrix not positive definite"
scipy.linalg.basic.LinAlgError: matrix not positive definite”.
My matrix is a real symmetric matrix and positive definite, so I don’t 
know why the error emerges. Have there some limits on the number of row and 
column in a matrix?  Please give me your help.


Thanks!

Best wishes,

yan

_
免费下载 MSN Explorer:   http://explorer.msn.com/lccn  

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor