Re: [Tutor] Enumeration and constant

2006-05-28 Thread Bob Gailer
Brendan Cheng wrote: I wander how to setup the enumeration type  and constant in Python, which I couldn't find the topic in the help file. There is no built-in enumeration type. See http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/67107 for an example of an enumeration c

[Tutor] a question about symbol

2006-05-28 Thread ron
When I run this program using your code on Ubuntu Linux, I get: ~$ ./c2f.py 44 44\uF = 7\uC Please notice that the code you have posted has indentation block errors. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protec

[Tutor] Enumeration and constant

2006-05-28 Thread Brendan Cheng
Hi,   I wander how to setup the enumeration type  and constant in Python, which I couldn't find the topic in the help file. I'm using python 2.4.3   please give me an example of it as well     Thanks,     Brendan ___ Tutor maillist - Tutor@python.org

[Tutor] Enumeration and Constant

2006-05-28 Thread Brendan Cheng
Hi,   I wander how to setup the enumeration type  and constant in Python, which I couldn't find the topic in the help file. I'm using python 2.4.3   please give me an example of it as well     Thanks,   Brendan ___ Tutor maillist - Tutor@python.org h

Re: [Tutor] a question about symbol

2006-05-28 Thread Bob Gailer
linda.s wrote: When I test the following code, I got something like (use 80 as argument): 80?F=27?C Why '?' appear? # code import string, sys # If no arguments were given, print a helpful message if len(sys.argv)==1: print 'Usage: celsius temp1 temp2 ...' sys.exit(0) # Loop over t

Re: [Tutor] a question about symbol

2006-05-28 Thread Danny Yoo
>> Let's compare the output to what we think is producing it. The very >> last statement in the program looks like the thing we want to watch: >> >> print '%i\260F = %i\260C' % (int(fahrenheit), int(celsius+.5)) >> >> One thing that caught me off guard is the '\260' thing. Can you explain >

Re: [Tutor] a question about symbol

2006-05-28 Thread linda.s
On 5/28/06, Danny Yoo <[EMAIL PROTECTED]> wrote: > > > On Sun, 28 May 2006, linda.s wrote: > > > When I test the following code, > > I got something like (use 80 as argument): > > 80?F=27?C > > Why '?' appear? > > > Hi Linda, > > Let's compare the output to what we think is producing it. The very

[Tutor] MySQLdb.converters.escape() type error

2006-05-28 Thread Jan Eden
Hi, after upgrading to MySQL 5 and MySQLdb 1.2.1_p2, I have the following problem: self.db=MySQLdb.connect(host=host, user=user, passwd=passwd, db=db, cursorclass=MySQLdb.cursors.DictCursor) stringel = 'Some string' stringel = self.db.escape(stringel) File "./test.py", line 12, in ? strin

Re: [Tutor] a question about symbol

2006-05-28 Thread Danny Yoo
On Sun, 28 May 2006, linda.s wrote: > When I test the following code, > I got something like (use 80 as argument): > 80?F=27?C > Why '?' appear? Hi Linda, Let's compare the output to what we think is producing it. The very last statement in the program looks like the thing we want to watch:

[Tutor] a question about symbol

2006-05-28 Thread linda.s
When I test the following code, I got something like (use 80 as argument): 80?F=27?C Why '?' appear? # code import string, sys # If no arguments were given, print a helpful message if len(sys.argv)==1: print 'Usage: celsius temp1 temp2 ...' sys.exit(0) # Loop over the arguments for i in