Re: [Tutor] question about the build-in function reversed in Python2.5

2011-12-24 Thread bob gailer
On 12/25/2011 12:02 AM, daedae11 wrote: The build-in function reversed() in Python2.5 returns a iterator. But I don't know how to use the iterator. Please give me a simple example about how to use bulid-in function reversed() to reverse a list. >>> [x for x in reversed([1,2,3])] [3, 2, 1] >>

Re: [Tutor] insert queries into related tables referencing foreign keys using python

2011-12-24 Thread Lie Ryan
On 12/25/2011 01:57 AM, Monte Milanuk wrote: Lie Ryan gmail.com> writes: Be careful that in multithreaded program, each thread should have their own cursors, or otherwise another thread could possibly do another insert before you can query the lastrowid. okay, this touches on something tha

[Tutor] question about the build-in function reversed in Python2.5

2011-12-24 Thread daedae11
The build-in function reversed() in Python2.5 returns a iterator. But I don't know how to use the iterator. Please give me a simple example about how to use bulid-in function reversed() to reverse a list. Thank you in advance. daedae11___ Tutor m

Re: [Tutor] A few Python Mysteries [Reset]

2011-12-24 Thread Lie Ryan
On 12/25/2011 06:24 AM, Alan Gauld wrote: On 24/12/11 18:58, Wayne Watson wrote: Yikes. I gave the permissions for .idlerc above. The problem is with recent-files.py. IOError: [Errno 13] Permission denied: 'C:\\Users\\Wayne\\.idlerc\\recent-files.lst' Can you open it in Notepad from the same

Re: [Tutor] A few Python Mysteries [Reset]

2011-12-24 Thread Alan Gauld
On 24/12/11 18:58, Wayne Watson wrote: Yikes. I gave the permissions for .idlerc above. The problem is with recent-files.py. IOError: [Errno 13] Permission denied: 'C:\\Users\\Wayne\\.idlerc\\recent-files.lst' Can you open it in Notepad from the same command prompt? ie. is it just idle that c

Re: [Tutor] A few Python Mysteries [Reset]

2011-12-24 Thread Wayne Watson
Yikes. I gave the permissions for .idlerc above. The problem is with recent-files.py. IOError: [Errno 13] Permission denied: 'C:\\Users\\Wayne\\.idlerc\\recent-files.lst' These are for it. Same as before except for Account Unknown, which had "list folder contents". Permissions as follows:

Re: [Tutor] Which libraries for Python 2.5.2

2011-12-24 Thread Hugo Arts
On Sat, Dec 24, 2011 at 6:37 PM, Wayne Watson wrote: > I'm trying to restore Python 2.5.2 on an old PC for a particular application > that uses it from 4-5 years ago. > According to the latest manual on it, the following should be installed. > > python-2.5.2.msi > PIL-1.1.6.win32-py2.5.exe > numpy

Re: [Tutor] A few Python Mysteries [Reset]

2011-12-24 Thread Wayne Watson
Permissions as follows: SYSTEM: All. From Full control to write Account Unknown(S-1-5-21...): read, exec, list folder contents, Read Wayne: (normal use) All. From Full control to write Admin: All. From Full control to write WMPNetwork: Read -- Wayne Watson (Watson Adventures, Prop.,

[Tutor] Which libraries for Python 2.5.2

2011-12-24 Thread Wayne Watson
I'm trying to restore Python 2.5.2 on an old PC for a particular application that uses it from 4-5 years ago. According to the latest manual on it, the following should be installed. python-2.5.2.msi PIL-1.1.6.win32-py2.5.exe numpy-1.1.0-win32-superpack-python2.5.exe matplotlib-0.98.1.win32-py2.

Re: [Tutor] A few Python Mysteries [Reset]

2011-12-24 Thread Wayne Watson
My guess is that some months ago I looked at .idlerc on another "mission" to figure what ails my python install, and just more or less backed up the recent-files.lst. However, the important point here is, I think, how to change the permissions for the .idlerc folder. They vary by how I might

Re: [Tutor] insert queries into related tables referencing foreign keys using python

2011-12-24 Thread Joel Goldstick
On Sat, Dec 24, 2011 at 9:57 AM, Monte Milanuk wrote: > Lie Ryan gmail.com> writes: > >> In python-sqlite, the rowid of the >> last insert operation can be queried using cursor.lastrowid. Therefore, >> you can query the lastrowid, right after the insert, to find the primary >> key of the value yo

Re: [Tutor] insert queries into related tables referencing foreign keys using python

2011-12-24 Thread Monte Milanuk
Lie Ryan gmail.com> writes: > In python-sqlite, the rowid of the > last insert operation can be queried using cursor.lastrowid. Therefore, > you can query the lastrowid, right after the insert, to find the primary > key of the value you had just inserted. So, in code: > > ... > cur = conn.exe