[Tutor] pysqlite and functions

2008-04-12 Thread Dinesh B Vadhia
I'm using a pysqlite select statement within a def function and it's not working because (I suspect) the pysqlite variables are not being declared corrrectly to be used within a def function or the def function is not setup correctly. Here is the code followed by the errors: code co

Re: [Tutor] SQLite LIKE question

2008-04-12 Thread Dinesh B Vadhia
Guys, I got it to work. The problem was to use pysqlite to search (in memory) a large number (>10,000) of string items containing the substring q (and to do it continuosly with different q's). The solution was to incase the substring q with % ie. '%q%'. The performance is excellent. The co

[Tutor] Simple copy script

2008-04-12 Thread Que Prime
I'm trying to copy files from one directory to another based on an input txt file containing the filename. Source directory = C:\test Destination directory = C:\output input.txt looks like: 12345.pdf 12344.pdf I having trouble getting my mind around a loop that would accomplish this. _

Re: [Tutor] Simple copy script

2008-04-12 Thread Evans Anyokwu
Its hard to tell what you're doing wrong without the code. Sorry, my policy is not to write code for anyone until they have something to show. On Sat, Apr 12, 2008 at 11:44 AM, Que Prime <[EMAIL PROTECTED]> wrote: > > I'm trying to copy files from one directory to another based on an input > txt

Re: [Tutor] Simple copy script

2008-04-12 Thread linuxian iandsd
right ! show us what you've done so far. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Simple copy script

2008-04-12 Thread Alan Gauld
"Que Prime" <[EMAIL PROTECTED]> wrote > I'm trying to copy files from one directory to another based on an > input txt > file containing the filename. > > Source directory = C:\test > Destination directory = C:\output > > input.txt looks like: > > 12345.pdf > 12344.pdf Try writing what you want

Re: [Tutor] pysqlite and functions

2008-04-12 Thread Alan Gauld
"Dinesh B Vadhia" <[EMAIL PROTECTED]> wrote Your code has several strangenesses in it but I'll focus on your query for now... con = sqlite3.connect(":memory:") # create database/table in memory cur = con.cursor()# note: can use the nonstandard execute, executeman

[Tutor] in-memory pysqlite databases

2008-04-12 Thread Dinesh B Vadhia
Say, you have already created a pysqlite database "testDB". In a Python program, you connect to the database as: > con = sqlite3.connect("testDB") > cur = con.cursor() To use a database in memory (ie. all the 'testDB' tables are held in memory) the pysqlite documentation says the declaration i

[Tutor] hey, a bit of a noob at python ut a question about animation...

2008-04-12 Thread John Jojo
I am trying to make a simple animation, and this is what I have. from livewires import games, color games.init(screen_width = 1000, screen_height = 1000, fps = 50) class Animation(games.Sprite): files1 = ["stick1.jpg"] files2 = ["stick2.jpg"] def __init__(self): self.animate1()

Re: [Tutor] hey, a bit of a noob at python ut a question about animation...

2008-04-12 Thread bob gailer
John Jojo wrote: I am trying to make a simple animation, and this is what I have.   from livewires import games, color games.init(screen_width = 1000, screen_height = 1000, fps = 50) class Animation(games.Sprite):     files1 = ["stick1.jpg"]     files2 = ["stick2.jpg"]     def __init

Re: [Tutor] in-memory pysqlite databases

2008-04-12 Thread bob gailer
Dinesh B Vadhia wrote: Say, you have already created a pysqlite database "testDB".  In a Python program, you connect to the database as:   > con = sqlite3.connect("testDB") > cur = con.cursor()   To use a database in memory (ie. all the 'testDB' tables are held in memory)

Re: [Tutor] hey, a bit of a noob at python ut a question about animation...

2008-04-12 Thread Alan Gauld
"John Jojo" <[EMAIL PROTECTED]> wrote > from livewires import games, color > ... > def main(): >wall_image = games.load_image("class.jpg", transparent = False) >games.screen.background = wall_image >animater = Animation() >games.screen.add(animater) >games.screen.mainloop() >

Re: [Tutor] in-memory pysqlite databases

2008-04-12 Thread Alan Gauld
"Dinesh B Vadhia" <[EMAIL PROTECTED]> wrote > Say, you have already created a pysqlite database "testDB". > In a Python program, you connect to the database as: > con = sqlite3.connect("testDB") > cur = con.cursor() OK so far. > To use a database in memory (ie. all the 'testDB' tables > are

Re: [Tutor] designing POOP

2008-04-12 Thread bhaaluu
On Sat, Feb 9, 2008 at 9:46 AM, Alan Gauld <[EMAIL PROTECTED]> wrote: > > As I mentioned in an earlier mail it tends to oscillate in practice. > You start off looking at the problem to identify the basic classes. > Then you pick one or two and start designing those in detail and > that identifi

Re: [Tutor] in-memory pysqlite databases

2008-04-12 Thread Dinesh B Vadhia
Bob An in-memory database that is empty to start, loaded with data, and goes away when the connection goes away is exactly what I'm after. The code and the program for an in-memory database works perfectly. However, a web version using webpy doesn't work - the error message is that it canno

Re: [Tutor] in-memory pysqlite databases

2008-04-12 Thread Alan Gauld
"Dinesh B Vadhia" <[EMAIL PROTECTED]> wrote > However, a web version using webpy doesn't work Now you didn't mention webpy before, that makes a big difference! > an execution thread is created by pysqlite and > another thread by webpy and hence webpy is not > seeing the table. Almost ce