[Tutor] Help with cursors please

2010-02-04 Thread Alan Harris-Reid
Hi, I have a SQLite cursor which I want to traverse more than once, eg... for row in MyCursor: method1(row) then later... for row in MyCursor: method2(row) Method2 is never run, I guess because the pointer is at the bottom of the row 'stack' after the first 'for' loop How can I mo

Re: [Tutor] Help with cursors please

2010-02-04 Thread Alan Harris-Reid
Kent Johnson wrote: On Thu, Feb 4, 2010 at 12:47 PM, Alan Harris-Reid wrote: Hi, I have a SQLite cursor which I want to traverse more than once, eg... for row in MyCursor: method1(row) then later... for row in MyCursor: method2(row) Method2 is never run, I guess because the pointer

[Tutor] Superclass call problem

2010-02-20 Thread Alan Harris-Reid
ethod do something else here When the super().__init__ line runs I get the error "__init__() takes exactly 1 positional argument (2 given)" Can anyone tell me where I have gone wrong? I thought the self parameter should be passed to all class methods. TIA A

Re: [Tutor] Superclass call problem

2010-02-20 Thread Alan Harris-Reid
Kent Johnson wrote: On Sat, Feb 20, 2010 at 12:50 PM, Alan Harris-Reid wrote: Hi, I am having trouble understanding how superclass calls work. Here's some code... class ParentClass(): def __init__(self): do something here You should inherit object to use super():

Re: [Tutor] Superclass call problem

2010-02-20 Thread Alan Harris-Reid
Luke Paireepinart wrote: Your call to super is wrong. It should be super and you pass the class and instance, then call init. On 2/20/10, Alan Harris-Reid wrote: Hi, I am having trouble understanding how superclass calls work. Here's some code... class ParentClass(): def __i

Re: [Tutor] Superclass call problem

2010-02-21 Thread Alan Harris-Reid
Hi, I am having trouble understanding how superclass calls work. Here's some code... What version of Python are you using? In Python 2.x, you MUST inherit from object to use super, and you MUST explicitly pass the class and self: class ParentClass(object): def __init__(self, a,

[Tutor] SQLite error messages

2010-03-09 Thread Alan Harris-Reid
are error codes, but it looks like the sqlite3 module is not reporting them. Has anyone any ideas how to get around this problem? TIA, Alan Harris-Reid ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://ma

Re: [Tutor] SQLite error messages

2010-03-10 Thread Alan Harris-Reid
Benno Lang wrote: On 10 March 2010 11:37, Alan Harris-Reid wrote: Hi there, I am using the sqlite3 module with Python 3.1, and have some code which goes something like as follows... import sqlite3 con = sqlite3.connect('MyDatabase.db') try: execresult = con.execute('INSE

Re: [Tutor] SQLite error messages

2010-03-10 Thread Alan Harris-Reid
Sander Sweers wrote: - Original message - I am using the sqlite3 module with Python 3.1, and have some code which goes something like as follows... import sqlite3 con = sqlite3.connect('MyDatabase.db') try: execresult = con.execute('INSERT INTO MyTable (field_name) VALUES ("

Re: [Tutor] Unable to run a simple Hello.py in WinXP

2010-05-17 Thread Alan Harris-Reid
Hi Siva, I can run the .py file from the DOS command line without any problem under WinXP. Can you give some more information regarding your error message? Regards, Alan Harris-Reid ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] Cherrypy and Iframes (or how to insert a file in a, page)

2011-04-09 Thread Alan Harris-Reid
ot directory, in which case you need the following in your configuration file. [/] tools.staticdir.root = '/path/to/root/folder' # no trailing backslash tools.staticdir.on = True tools.staticdir.dir = "" # necessary to serve static files in