[Tutor] Should config file parser be in module's __init__.py

2008-03-17 Thread Shrutarshi Basu
I'm working on a module consisting of a number of scripts that handle communications over a serial connection. I would like someway for the user to be able to specify which serial port to be used based on a config file in the same directory as the user's program. Should I place the parsing system i

[Tutor] Foothill College Spring Courses

2008-03-17 Thread Elaine
Spring quarter classes start Monday, 7 April, at Foothill College. These two may be of interest to you: 1) Introduction to Python Programming - 5 units Prerequisite: Any programming language experience CIS 68K - Monday evenings at Middlefield campus in Palo Alto 2) Application Software Developmen

Re: [Tutor] python, wxpython and postgresql

2008-03-17 Thread Chris Fuller
There are at least a couple of python interfaces to postgresql, but psycopg follows the DB-API spec. You shouldn't have to use the postgresql engine directly. http://www.initd.org/pub/software/psycopg/ The cool bit is that the examples you see that follow DB-API will apply to postgresql, exce

Re: [Tutor] python, wxpython and postgresql

2008-03-17 Thread Chris Fuller
Unless you have a specific reason for choosing postgresql (an excellent database, just not the easiest), such as having an existing installation, desiring networked access, or nice features such as type safety, you might want to consider SQLite instead. Also, if you stick to the DB-API spec, yo

Re: [Tutor] python, wxpython and postgresql

2008-03-17 Thread Bill Mais
Hey, I thought programming was all about the shortcuts ;-) I'm sorry to not be clear. I've done several excellent python + postgresql tutorials, but the one I have not found is wxPython + postgresql (or any database). Specifically, how would you take your sql results and set the values of you

Re: [Tutor] python, wxpython and postgresql

2008-03-17 Thread Eric Walstad
Hey Bill, Bill Mais wrote: > I'm a newbie to python and would like to build a database app with > wxpython and postgresql. I would suggest you first write the basic app to work from the command line. It's easy to debug that way and enables you to focus on the critical features of your app witho

Re: [Tutor] how to get response from os.system()

2008-03-17 Thread Luke Paireepinart
Nathan McBride wrote: > That's a great tip I'll have to save than. Nathan, I'm not sure why you sent this three times, but we've gotten it, if you're worried about it. Thanks, -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/l

Re: [Tutor] how to get response from os.system()

2008-03-17 Thread Nathan McBride
That's a great tip I'll have to save than. -Original Message- From: Martin Walsh <[EMAIL PROTECTED]> Sent: Monday, March 17, 2008 9:38 AM To: Nathan McBride <[EMAIL PROTECTED]> Cc: tutor@python.org Subject: Re: [Tutor] how to get response from os.system() Hi Nathan, Nathan McBride wrote

Re: [Tutor] how to get response from os.system()

2008-03-17 Thread Nathan McBride
That's a great tip I'll have to save than. -Original Message- From: Martin Walsh <[EMAIL PROTECTED]> Sent: Monday, March 17, 2008 9:38 AM To: Nathan McBride <[EMAIL PROTECTED]> Cc: tutor@python.org Subject: Re: [Tutor] how to get response from os.system() Hi Nathan, Nathan McBride wrote

Re: [Tutor] python, wxpython and postgresql

2008-03-17 Thread Luke Paireepinart
Bill Mais wrote: > I'm a newbie to python and would like to build a database app with > wxpython and postgresql. Aside from Dabo, I have not found any > tutorials that cover reading and writing to a database. Is it so easy > that examples are not needed or so impossible that no one can do it.

[Tutor] python, wxpython and postgresql

2008-03-17 Thread Bill Mais
I'm a newbie to python and would like to build a database app with wxpython and postgresql. Aside from Dabo, I have not found any tutorials that cover reading and writing to a database. Is it so easy that examples are not needed or so impossible that no one can do it. Can someone point me in

Re: [Tutor] how to get response from os.system()

2008-03-17 Thread Nathan McBride
That's a great tip I'll have to save than. -Original Message- From: Martin Walsh <[EMAIL PROTECTED]> Sent: Monday, March 17, 2008 9:38 AM To: Nathan McBride <[EMAIL PROTECTED]> Cc: tutor@python.org Subject: Re: [Tutor] how to get response from os.system() Hi Nathan, Nathan McBride wrote

Re: [Tutor] my first project: a multiplication trainer

2008-03-17 Thread Chris Fuller
You should try some of the Python tutorials out there. There's a difference between tuples and lists, and the parameter list passed to the string formatting operator must be a tuple. String formatting will also solve your second problem. Also, the library reference is your friend. I particu

Re: [Tutor] how to get response from os.system()

2008-03-17 Thread Nathan McBride
That's a great tip I'll have to save than. -Original Message- From: Martin Walsh <[EMAIL PROTECTED]> Sent: Monday, March 17, 2008 9:38 AM To: Nathan McBride <[EMAIL PROTECTED]> Cc: tutor@python.org Subject: Re: [Tutor] how to get response from os.system() Hi Nathan, Nathan McBride wrote

Re: [Tutor] my first project: a multiplication trainer

2008-03-17 Thread Guba
Dear Chris, list, cheers for the great help: very valuable indeed. Chris Fuller wrote: ## for proxyq in choices: q = questions[proxyq] answer = raw_input('%dx%d = ' % tuple(q)) if int(answer) == q[0]*q[1]: print 'correct' else: print 'incorrect'

Re: [Tutor] how to get response from os.system()

2008-03-17 Thread Martin Walsh
Hi Nathan, Nathan McBride wrote: > Yup I use the pexpect module for a lot however couldn't get 'pexpect.run' to > work with mysqldump piping to gzip > Just to hazard a guess -- when you want to pipe commands with pexpect you have to spawn ('run', it seems, would work the same way) the shell c