Re: [Tutor] MySQLdb: cant get '... where field in %s' to work

2006-06-25 Thread Justin Ezequiel
I wrote: >> ARTICLES = ('XXX9', 'ABZ2') >> TESTARTICLENAME = """SELECT * FROM tblForTransfer2Prodsite >> WHERE articleName IN %r""" % (ARTICLES,) >> SQLARTICLENAME = """SELECT * FROM tblForTransfer2Prodsite >> WHERE articleName IN %s""" >> >> print cur.execute(TESTARTICLENAME), >>

[Tutor] database help for newbie, fetchall()

2006-06-25 Thread Rene Bourgoin
What is the best way to handle the resutls to a fetchall() command? The result seems to be a list of tuples [(aaa,bbb,ccc0,(11,222,333,)]. I'm new to programming but it seems that what ever I try to accomplish at some point i need the results to end up as strings. Even if you loop through the li

[Tutor] for teachers and students: xturtle.py a new tutle graphics module

2006-06-25 Thread Gregor Lingl
xturtle.py, extended turtle graphics a new turtle graphics module for Python and Tkinter Version 0.9 of xturtle.py has been released. It can be found at: http://ada.rg16.asn-wien.ac.at/~python/xturtle xturtle should work properly on all major platforms (Mac, Linux and Windows) Feedback would be

Re: [Tutor] doubt in Regular expressions

2006-06-25 Thread Luke Paireepinart
Post Script: Sorry for the double e-mail, Evans. I forgot to forward it to the list the first time. Also, why don't replies automatically forward themselves to the list like the pygame mailing list does? For privacy reasons, in case you want to reply to someone separately? End of P.S. -

Re: [Tutor] beginner: using optional agument in __init__ breaks my code

2006-06-25 Thread Barbara Schneider
--- Karl Pflästerer <[EMAIL PROTECTED]> schrieb: > > The values of optional arguments are only once > evaluated (when Python > reads the definition). If you place there mutable > objects like e.g. a > list most of the time the effect you see is not what > you want. So you > have to write it a bi

Re: [Tutor] beginner: using optional agument in __init__ breaks my code

2006-06-25 Thread Bob Gailer
Barbara Schneider wrote: > Hello Group, I am puzzled about this: The following > code implements a simple FIFO object. > > class Queue: > "Implementing a FIFO data structure." > > # Methods > def __init__(self): > self.queue = [] > > def emptyP(self): > return (s

Re: [Tutor] doubt in Regular expressions

2006-06-25 Thread Evans Anyokwu
bump - Original Message - From: ravi sankar To: tutor@python.org Sent: Sunday, June 25, 2006 9:17 PM Subject: [Tutor] doubt in Regular expressions hello all,  i want to search strings in the database available and return the link of the string instead  simply

[Tutor] doubt in Regular expressions

2006-06-25 Thread ravi sankar
hello all,  i want to search strings in the database available and return the link of the string instead  simply returning the words...  by using regular expressions(RE) i got a way to perform the  string matchesgive some info regarding how to return the link of the matched strings...  ravi. _

Re: [Tutor] beginner: using optional agument in __init__ breaks my code

2006-06-25 Thread Karl Pflästerer
On 25 Jun 2006, [EMAIL PROTECTED] wrote: [...] > This code works as intended. Now my idea is to provide > an optional argument to the constructor. So I change > it to: > > def __init__(self, q =[]): > self.queue = q > > Now, something very strange happens: > a = Queue() b =

Re: [Tutor] search engine

2006-06-25 Thread Evans Anyokwu
it would be very hard to know the type of help you need at this time. You have not really written a single line of code and besides, no one will start it for you unless you have a specific problem that needs attention.   Again, it sounds to me as though you've not actually grasped the scope

[Tutor] beginner: using optional agument in __init__ breaks my code

2006-06-25 Thread Barbara Schneider
Hello Group, I am puzzled about this: The following code implements a simple FIFO object. class Queue: "Implementing a FIFO data structure." # Methods def __init__(self): self.queue = [] def emptyP(self): return (self.queue == []) def insert(self, item):

Re: [Tutor] Is this correct syntax for what I want?

2006-06-25 Thread Alan Gauld
> File "C:\Python24\Account Tracker.py", line 10, in load_file >amount = line.next().strip() > AttributeError: 'str' object has no attribute 'next' > > According to it, the 'str' object has no attribute 'next'. So how > would I load my file containing my data? The str object in question is l

Re: [Tutor] Is this correct syntax for what I want?

2006-06-25 Thread Nathan Pinno
When I loaded it up, I got the following error: Traceback (most recent call last): File "C:\Python24\Account Tracker.py", line 82, in ? load_file(accountlist) File "C:\Python24\Account Tracker.py", line 10, in load_file amount = line.next().strip() AttributeError: 'str' object has no a

Re: [Tutor] Is this correct syntax for what I want?

2006-06-25 Thread Nathan Pinno
Thanks, it works now perfectly! Thanks for all the help! - Original Message - From: "Alan Gauld" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]>; Sent: Sunday, June 25, 2006 1:07 AM Subject: Re: [Tutor] Is this correct syntax for what I want? >> File "C:\Python24\Account Tra

Re: [Tutor] Is this correct syntax for what I want?

2006-06-25 Thread Alan Gauld
> File "C:\Python24\Account Tracker.py", line 49, in printall >print account,"\t $",accountlist[account]+"\n" > TypeError: unsupported operand type(s) for +: 'float' and 'str' > > So how do I fix this error? What it's saying is you can't add a float and string. If you look at the code you a