Re: [Tutor] perplexing error with shelve REVISED

2007-10-30 Thread Aditya Lal
On 10/31/07, Orest Kozyar <[EMAIL PROTECTED]> wrote: > > > Please post the entire traceback (omitting duplicate lines). > > Sorry, I should have included the traceback. I've revised the sample > script > so that it generates the traceback when run. The sample script is at the > very bottom of thi

Re: [Tutor] question re type()

2007-10-30 Thread Aditya Lal
On 10/29/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > > Aditya Lal wrote: > > or use types module > > > > import types > > > > if type(n) == types.IntType or type(n) == types.LongType : > > blah! > > A few notes: > - If you look at types.py, you find > IntType = int > LongType = long > > and s

Re: [Tutor] Looking for suggestions for improving chessTimer.py code

2007-10-30 Thread Dick Moores
At 03:49 AM 10/30/2007, Kent Johnson wrote: >Why do you need to call kbhit() at all? Why not just call getch() >and wait for the next character? Like this?: . The every-5-seconds time report doesn't report. Compare =

Re: [Tutor] perplexing error with shelve REVISED

2007-10-30 Thread Orest Kozyar
> Please post the entire traceback (omitting duplicate lines). Sorry, I should have included the traceback. I've revised the sample script so that it generates the traceback when run. The sample script is at the very bottom of this email. ### SCRIPT OUTPUT ### [kozyar]:~$ python exampl

Re: [Tutor] perplexing error with shelve

2007-10-30 Thread bob gailer
Orest Kozyar wrote: > I have a program which queries an online database (Medline) for XML data. > It caches all data using shelve to avoid hitting the database too many > times. For some reason, I keep getting a RuntimeError: maximum recursion > depth exceeded when attempting to add a certain reco

Re: [Tutor] perplexing error with shelve REVISED

2007-10-30 Thread Bob Gailer
Orest Kozyar wrote: > I have a program which queries an online database (Medline) for XML data. > It caches all data using shelve to avoid hitting the database too many > times. For some reason, I keep getting a RuntimeError: maximum recursion > depth exceeded when attempting to add a certain reco

[Tutor] Fwd: [pycon-tutorials] Request: Python Instruction Needed for GIS Symposium

2007-10-30 Thread Greg Lindstrom
We received this on the PyCon tutorial list. Anyone interested?? Thanks, --greg -- Forwarded message -- From: [EMAIL PROTECTED] <[EMAIL PROTECTED]> Date: Oct 30, 2007 11:18 AM Subject: [pycon-tutorials] Request: Python Instruction Needed for GIS Symposium To: [EMAIL PROTECTED]

[Tutor] perplexing error with shelve

2007-10-30 Thread Orest Kozyar
I have a program which queries an online database (Medline) for XML data. It caches all data using shelve to avoid hitting the database too many times. For some reason, I keep getting a RuntimeError: maximum recursion depth exceeded when attempting to add a certain record. This program has succes

Re: [Tutor] Looking for suggestions for improving chessTimer.py code

2007-10-30 Thread bob gailer
I also encourage you to jump into classes. Yes there is a learning curve. It is IMHO worth it. Borrowing from Kent Johnson: class Player(object): def __init__(self, name, moveCounter, remainingTime): self.name = name self.moveCounter = moveCounter self.remainingTime = remaining

[Tutor] [Fwd: ANN: Learning Python 3rd Edition]

2007-10-30 Thread Kent Johnson
There is a new edition of one of my recommended books. Kent Original Message Subject: ANN: Learning Python 3rd Edition Date: Mon, 29 Oct 2007 12:28:10 -0700 (GMT-07:00) From: [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED], [EMAIL PROTECTED] To: [EMAIL PROTECTED] I'm pleased to a

Re: [Tutor] Looking for suggestions for improving chessTimer.py code

2007-10-30 Thread Kent Johnson
Dick Moores wrote: >>> 2. I've used 1 for White player, -1 for Black player, and (-1)*player >>> to alternate players. Is there a better way? >>> 3. I've used a lot of variables. Too Many? >> >> I think it might work well to either put the player variables into >> lists or simple classes. > > I

Re: [Tutor] repeated times

2007-10-30 Thread Alan Gauld
"linda.s" <[EMAIL PROTECTED]> wrote >I want to run an .exe file and get the output many times. > Can any one give me an example about how to use python to generate > the > automatic process? Given that I know that you know about loops I have to ask what you see as the problem? Just run the proc