[Tutor] Python CGI Script

2006-09-20 Thread Faran
I Have a CGI Script Which is working perfectly when run from the python interpreter, i m using the Content-type: application/x-www-url-form-encoded , i use it to send data from flash apps to python script. i checked the script with content-type: text/html , and browsers printed the output perfe

Re: [Tutor] Python CGI Script

2006-09-20 Thread Kent Johnson
Faran wrote: > I Have a CGI Script Which is working perfectly when run from the python > interpreter, i m using the Content-type: > application/x-www-url-form-encoded , i use it to send data from flash > apps to python script. i checked the script with content-type: text/html > , and browsers p

[Tutor] Python and Gecko

2006-09-20 Thread Sebastian Smith
Hello All! I am not a Python expert at all but I am learning when I have time. I am currently working my way through 'wxPython in Action' and really liking it, I have been using Learning to Program as my central text. Anyway, I was wondering if there is anyway to use the Mozilla Gecko engine in P

Re: [Tutor] How to convert a decimal integer into binary

2006-09-20 Thread wesley chun
> I came across some code, which uses bit operator. I could not understand how > the logic of that code. If anyone knows to convert the decimal into binary > using BIT OPERATOR, then please help me. please reply to the list, not just me. since this is your homework assignment, i cannot give you

Re: [Tutor] Python CGI Script

2006-09-20 Thread Danny Yoo
>query1 = """SELECT ABC FROM %s limit %s,%s"""\ > % (self.tableid,self.rangeid1,self.rangeid2) Just as a note: please don't do this! *grin* Don't build query strings up like this: this is very prone to an SQL injection attack. See: http://mail.python.org/pipe

[Tutor] Overloading the assignment operator in a class

2006-09-20 Thread Carroll, Barry
Greetings: I have a class that implements a die (singular or dice). Here is the class definition: >>> class Die(object): """Implements a gaming die. Attributes: n: the number of sides Must correspond to the number of sides on a physical die. val

Re: [Tutor] Overloading the assignment operator in a class

2006-09-20 Thread Alan Gauld
> This all seems to work okay. > > I want the assignment operator ('=') There is no assignment operator in Python, assignment is a binding of an object to a name. > to call the > set method transparently on Die instances, > as in this fictitious example: @BCARROLL[Python]|6> mydie = 5 @BCA

Re: [Tutor] Overloading the assignment operator in a class

2006-09-20 Thread Jordan Greenberg
Carroll, Barry wrote: > Greetings: > > I have a class that implements a die (singular or dice). Here is the class > definition: > How do I overload the '=' operator to give the desired behavior? > > Regards, > > Barry AFAIK, you can't. Unlike, say, Java or C++, the assignment operator is no

Re: [Tutor] Overloading the assignment operator in a class

2006-09-20 Thread Jordan Greenberg
Alan Gauld wrote: >> This all seems to work okay. >> >> I want the assignment operator ('=') > > There is no assignment operator in Python, assignment is a > binding of an object to a name. > >> to call the >> set method transparently on Die instances, >> as in this fictitious example: > >

Re: [Tutor] Python CGI Script

2006-09-20 Thread Mike Hansen
> -Original Message- > Subject: Re: [Tutor] Python CGI Script > > >query1 = """SELECT ABC FROM %s limit %s,%s"""\ > > % (self.tableid,self.rangeid1,self.rangeid2) > > Just as a note: please don't do this! *grin* > > Don't build query strings up like this:

Re: [Tutor] Python CGI Script

2006-09-20 Thread Python
On Wed, 2006-09-20 at 15:46 -0600, Mike Hansen wrote: > > > -Original Message- > > Subject: Re: [Tutor] Python CGI Script > > > > >query1 = """SELECT ABC FROM %s limit %s,%s"""\ > > > % (self.tableid,self.rangeid1,self.rangeid2) > > > > Just as a note: pleas

Re: [Tutor] Overloading the assignment operator in a class

2006-09-20 Thread wesley chun
On 9/20/06, Alan Gauld <[EMAIL PROTECTED]> wrote: > > This all seems to work okay. > > > > I want the assignment operator ('=') > > There is no assignment operator in Python, assignment is a > binding of an object to a name. as others have mentioned, the assignment operator is used to assign an o

[Tutor] Paramstyle/sql injection [was Python CGI Script]

2006-09-20 Thread Tim Johnson
* Danny Yoo <[EMAIL PROTECTED]> [060920 10:41]: > >query1 = """SELECT ABC FROM %s limit %s,%s"""\ > > % (self.tableid,self.rangeid1,self.rangeid2) > > Just as a note: please don't do this! *grin* > > Don't build query strings up like this: this is very prone to an SQ

Re: [Tutor] Paramstyle/sql injection [was Python CGI Script]

2006-09-20 Thread Danny Yoo
> Was talking to my partner about this. He's a perl programmer, and he > told me that (if I understood him correctly) that the programmer is > required by perl to use the 'prepare' function in the perl DBI prior to > sending a select statement. Hi Tim, Yes. That being said, Perl's prepare() s

Re: [Tutor] Overloading the assignment operator in a class

2006-09-20 Thread Kent Johnson
Carroll, Barry wrote: > How do I overload the '=' operator to give the desired behavior? This classic essay talks about the meaning of assignment in Python: http://www.effbot.org/zone/python-objects.htm Also I don't think there is any need to overload __lt__, etc.; just __cmp__ is enough, it wil