[Tutor] Class-based generator

2013-02-17 Thread Michael O'Leary
I wrote some code to create tasks to be run in a queue based system last week. It consisted of a big monolithic function that consisted of two parts: 1) read data from a file and create dictionaries and lists to iterate through 2) iterate through the lists creating a job data file and a task for th

Re: [Tutor] Invoking python script

2013-02-17 Thread Oscar Benjamin
On 17 February 2013 15:57, Alan Gauld wrote: > On 17/02/13 09:14, Brajesh pant wrote: >> >> Actually i want to build a utility such that a when a file or folder > >> is copied i want to automatically run my python script .. >> > > And this is a far different thing because you specifically want to

Re: [Tutor] Need help with sqlite3 in python

2013-02-17 Thread Jim Byrnes
On 02/17/2013 12:31 PM, Alan Gauld wrote: On 17/02/13 16:50, Jim Byrnes wrote: cur.execute("INSERT INTO pwds VALUES ('WebSites', 'xMe', 'me', 'you', 'here', 'there')") When this code is run, done prints in the terminal, there is no error Can you do selects properly? Can you extract data

Re: [Tutor] Need help with sqlite3 in python

2013-02-17 Thread Alan Gauld
On 17/02/13 16:50, Jim Byrnes wrote: cur.execute("INSERT INTO pwds VALUES ('WebSites', 'xMe', 'me', 'you', 'here', 'there')") When this code is run, done prints in the terminal, there is no error Can you do selects properly? Can you extract data put in manually? That would prove the conn

[Tutor] Need help with sqlite3 in python

2013-02-17 Thread Jim Byrnes
I am writing a small database CRUD app using python 2.7, pythoncard, sqlite3 on Ubuntu 12.04. So far I can retrieve data fine but I cannot do inserts. In my first attempt I used parameter substitution. When that did not work I thought I didn't understand it and decided to try a simple insert.

Re: [Tutor] Invoking python script

2013-02-17 Thread Alan Gauld
On 17/02/13 09:14, Brajesh pant wrote: Hello there .. I want to know is there any python module which can tell > when a cut command or copy command is invoked. There are but probably not trivially. but you need to understand what you are asking for. A cut/copy command is a desktop environment

Re: [Tutor] Invoking python script

2013-02-17 Thread Steven D'Aprano
On 17/02/13 20:14, Brajesh pant wrote: Hello there .. I want to know is there any python module which can tell when a cut command or copy command is invoked. Invoked by what? What program is doing the copy or cut? Actually i want to build a utility such that a when a file or folder is copied

[Tutor] Invoking python script

2013-02-17 Thread Brajesh pant
Hello there .. I want to know is there any python module which can tell when a cut command or copy command is invoked. Actually i want to build a utility such that a when a file or folder is copied i want to automatically run my python script .. Thanks Brajesh Pant _

Re: [Tutor] Python API

2013-02-17 Thread Alan Gauld
On 17/02/13 03:21, Steven D'Aprano wrote: On 17/02/13 12:34, Alan Gauld wrote: It's unusual for any website to allow other people to change it. *cough* You may have heard of a little site called "Wikipedia"... ? Yep, that's why I said 'unusual' not 'unknown'. :-) But wiki's are a very spe