Re: Trouble writing to database: RSS-reader

2008-01-21 Thread Arne
On 21 Jan, 19:15, Bruno Desthuilliers wrote: > This should not prevent you from learning how to properly parse XML > (hint: with an XML parser). XML is *not* a line-oriented format, so you > just can't get nowhere trying to parse it this way. > > HTH Do you think i should use xml.dom.minidom for

Re: ctypes CDLL - which paths are searched?

2008-01-21 Thread Thomas Heller
Helmut Jarausch schrieb: > Hi, > > how can I specify the paths to be searched for a dynamic library > to be loaded by ctypes' CDLL class on a Linux system. > > Do I have to set os.environment['LD_LIBRARY_PATH'] ? > ctypes passes the argument given to CDLL(path) straight to the dlopen(3) call, s

Transforming ascii file (pseduo database) into proper database

2008-01-21 Thread p.
I need to take a series of ascii files and transform the data contained therein so that it can be inserted into an existing database. The ascii files are just a series of lines, each line containing fields separated by '|' character. Relations amongst the data in the various files are denoted throu

Re: index of min element of sequence

2008-01-21 Thread Paul Rubin
John Machin <[EMAIL PROTECTED]> writes: > s/[1]/[0]/ or more generally: Oops, got two spellings confused. Originally was going to use from itertools import count, izip min(izip(seq, count()))[1] but did it with enumerate instead. I don't know which is actually faster. > minindex, minvalue =

problem deriving form type long

2008-01-21 Thread Frederic Rentsch
Hi, here's something that puzzles me: >>> class Fix_Point (long): def __init__ (self, l): long.__init__ (self, l * 0x1): >>> fp = Fix_Point (99) >>> fp 99 With prints: >>> class Fix_Point (long): def __init__ (self, l): print l l_ = l *

Re: is it possible to set namespace to an object.

2008-01-21 Thread George Sakkis
On Jan 21, 2:52 pm, glomde <[EMAIL PROTECTED]> wrote: > On 21 Jan, 20:16, George Sakkis <[EMAIL PROTECTED]> wrote: > > > > > On Jan 21, 1:56 pm, glomde <[EMAIL PROTECTED]> wrote: > > > > On 21 Jan, 18:59, Wildemar Wildenburger > > > > <[EMAIL PROTECTED]> wrote: > > > > glomde wrote: > > > > > Hi, >

Re: Transforming ascii file (pseduo database) into proper database

2008-01-21 Thread Tim Chase
> I need to take a series of ascii files and transform the data > contained therein so that it can be inserted into an existing > database. [snip] > I need to transform the data from the files before inserting > into the database. Now, this would all be relatively simple if > not for the followin

Re: problem deriving form type long

2008-01-21 Thread Gabriel Genellina
En Mon, 21 Jan 2008 18:33:10 -0200, Frederic Rentsch <[EMAIL PROTECTED]> escribi�: > Hi, here's something that puzzles me: > > >>> class Fix_Point (long): > def __init__ (self, l): >long.__init__ (self, l * 0x1): > > >>> fp = Fix_Point (99) > >>> fp > 99 You have

Re: Help with cPAMIE

2008-01-21 Thread romo20350
On Jan 21, 11:09 am, [EMAIL PROTECTED] wrote: > Hi, I'm in need of help with cPAMIE. I'm currently trying to submit > this form on a webpage: > > > > Submit Coupon > Coupon Code: > > > > Submit Coupon > > > > I can fill in the textboxes alright but I'm having trouble submitting > it. I've tr

Re: Transforming ascii file (pseduo database) into proper database

2008-01-21 Thread John Machin
On Jan 22, 7:51 am, "p." <[EMAIL PROTECTED]> wrote: > I need to take a series of ascii files and transform the data > contained therein so that it can be inserted into an existing > database. The ascii files are just a series of lines, each line > containing fields separated by '|' character. Relat

Re: Transforming ascii file (pseduo database) into proper database

2008-01-21 Thread Paul Rubin
"p." <[EMAIL PROTECTED]> writes: > 1. Has anyone done anything like this before, and if so, do you have > any advice? Sort all the files with an external sort utility (e.g. unix sort), so that records with the same key are all brought together. Then you can process the files sequentially. -- htt

Re: index of min element of sequence

2008-01-21 Thread John Machin
On Jan 22, 7:56 am, Paul Rubin wrote: > John Machin <[EMAIL PROTECTED]> writes: > > s/[1]/[0]/ or more generally: > > Oops, got two spellings confused. Originally was going to use > > from itertools import count, izip > min(izip(seq, count()))[1] > > but did it with en

pygep

2008-01-21 Thread Blubaugh, David A.
To Anyone out there!! I was wondering if anyone out there has had any experience with pygep program. this program is an open source version for Gene Expression Programming, which I will need to utilize in order to complete my Master's Thesis. Thanks for any help!! David Blubaug

Re: index of min element of sequence

2008-01-21 Thread Paul Rubin
John Machin <[EMAIL PROTECTED]> writes: > >>> from itertools import count, izip > >>> min(izip(seq, count())) > (7, 3) Serves me right for cutting and pasting. minvalue, minindex = min(izip(seq, count())) -- http://mail.python.org/mailman/listinfo/python-list

Re: Bug in __init__?

2008-01-21 Thread Steven D'Aprano
On Mon, 21 Jan 2008 17:38:10 -0200, Gabriel Genellina wrote: > En Mon, 21 Jan 2008 05:59:38 -0200, <[EMAIL PROTECTED]> escribi�: > >> Is there no way of adding a possible warning message (that obviously >> could be turned off) to warn users of possible problems linked to using >> mutable types as

Re: Trouble writing to database: RSS-reader

2008-01-21 Thread Bruno Desthuilliers
Arne a écrit : > On 21 Jan, 19:15, Bruno Desthuilliers [EMAIL PROTECTED]> wrote: > >> This should not prevent you from learning how to properly parse XML >> (hint: with an XML parser). XML is *not* a line-oriented format, so you >> just can't get nowhere trying to parse it this way. >> >> HTH >

Re: When is min(a, b) != min(b, a)?

2008-01-21 Thread Steven D'Aprano
On Mon, 21 Jan 2008 18:00:05 +, Pete Forman wrote: > If NaNs in your data are important then you must take care in explicit > and implicit comparisons to consider unordered results. And even if they're not important, beware of bugs from failing to consider unordered results due to unexpected

Re: Trouble writing to database: RSS-reader

2008-01-21 Thread Gabriel Genellina
En Mon, 21 Jan 2008 18:38:48 -0200, Arne <[EMAIL PROTECTED]> escribi�: > On 21 Jan, 19:15, Bruno Desthuilliers [EMAIL PROTECTED]> wrote: > >> This should not prevent you from learning how to properly parse XML >> (hint: with an XML parser). XML is *not* a line-oriented format, so you >> just can'

Prioritization function needed (recursive help!)

2008-01-21 Thread rh0dium
Hi all, I need some help on writing a recursive priority function Given a list = [ A, B, C, D] Where the following constraints are in place: A depends on [B, C] C depends on [B] Figure out real order that prioritizes these. Output [ B, C, A, D ] is valid. (Actually D could be anywhere in it

Re: Transforming ascii file (pseduo database) into proper database

2008-01-21 Thread George Sakkis
On Jan 21, 4:45 pm, Paul Rubin wrote: > "p." <[EMAIL PROTECTED]> writes: > > 1. Has anyone done anything like this before, and if so, do you have > > any advice? > > Sort all the files with an external sort utility (e.g. unix sort), so > that records with the same key are

Re: Prioritization function needed (recursive help!)

2008-01-21 Thread Paul Rubin
rh0dium <[EMAIL PROTECTED]> writes: > I am really struggling on simply how to organize the data and write > the corresponding function - I tried classes but I don't know if > that's the best approach. See my other post on this. We just had a discussion thread about this. Is it a homework problem

Re: Prioritization function needed (recursive help!)

2008-01-21 Thread Arnaud Delobelle
On Jan 21, 10:30 pm, rh0dium <[EMAIL PROTECTED]> wrote: > Hi all, > > I need some help on writing a recursive priority function > > Given a list = [ A, B, C, D] > > Where the following constraints are in place: > > A depends on [B, C] > C depends on [B] > > Figure out real order that prioritizes th

Re: Transforming ascii file (pseduo database) into proper database

2008-01-21 Thread p.
So in answer to some of the questions: - There are about 15 files, each roughly representing a table. - Within the files, each line represents a record. - The formatting for the lines is like so: File1: somval1|ID|someval2|someval3|etc. File2: ID|someval1|someval2|somewal3|etc. Where ID is the o

PyGTK, Glade, and ComboBoxEntry.append_text()

2008-01-21 Thread Greg Johnston
Hey all, I'm a relative newbie to Python (switched over from Scheme fairly recently) but I've been using PyGTK and Glade to create an interface, which is a combo I'm very impressed with. There is, however, one thing I've been wondering about. It doesn't seem possible to modify ComboBoxEntry choic

Re: Prioritization function needed (recursive help!)

2008-01-21 Thread Kent Johnson
rh0dium wrote: > Hi all, > > I need some help on writing a recursive priority function > > Given a list = [ A, B, C, D] > > Where the following constraints are in place: > > A depends on [B, C] > C depends on [B] > > Figure out real order that prioritizes these. You need a topological sort. h

constructor question

2008-01-21 Thread azrael
lets supose i have a object >>>class a: >>> __init__(self,b): >>>self.b=b >>>object=a(2) how can I bind the object with "print". I supose that this should be possible with a constructor. but I don't know how. >>>print a 2 >>> Something like this Thnx -- http://mail.python.org/mai

Re: constructor question

2008-01-21 Thread TeroV
azrael wrote: > lets supose i have a object > class a: __init__(self,b): self.b=b > object=a(2) > > > how can I bind the object with "print". I supose that this should be > possible with a constructor. but I don't know how. > print a > 2 > > Something like th

Re: bags? 2.5.x?

2008-01-21 Thread Dan Stromberg
On Thu, 17 Jan 2008 18:18:53 -0800, Raymond Hettinger wrote: >> >> I keep wanting something like them - especially bags with something >> >> akin to set union, intersection and difference. >> >> > How about this recepie >> > http://www.ubookcase.com/book/Oreilly/ >> >> The author of the bag class

Re: Transforming ascii file (pseduo database) into proper database

2008-01-21 Thread Bruno Desthuilliers
p. a écrit : > I need to take a series of ascii files and transform the data > contained therein so that it can be inserted into an existing > database. The ascii files are just a series of lines, each line > containing fields separated by '|' character. Relations amongst the > data in the various

Max Long

2008-01-21 Thread tjhnson
How can I figure out the largest long available? I was hoping for something like sys.maxint, but I didn't see it. Also, can someone point me to where I can (concisely) read about size of such types (int, float, long). -- http://mail.python.org/mailman/listinfo/python-list

Re: Transforming ascii file (pseduo database) into proper database

2008-01-21 Thread Paul Rubin
"p." <[EMAIL PROTECTED]> writes: > So as an exercise, lets assume 800MB file, each line of data taking up > roughly 150B (guesstimate - based on examination of sample data)...so > roughly 5.3 million unique IDs. I still don't understand what the problem is. Are you familiar with the concept of ex

Re: Max Long

2008-01-21 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > How can I figure out the largest long available? Why would you? AFAIK, longs are only limited by available memory. > I was hoping for something like sys.maxint, but I didn't see it. > Also, can someone point me to where I can (concisely) read about > size of such types

Re: constructor question

2008-01-21 Thread azrael
5 days ago I looked at it and didn't take a notice. thnx, this helped On Jan 22, 12:10 am, TeroV <[EMAIL PROTECTED]> wrote: > azrael wrote: > > lets supose i have a object > > class a: >   __init__(self,b): >        self.b=b > > object=a(2) > > > how can I bind the object wit

Re: Max Long

2008-01-21 Thread Gary Herron
[EMAIL PROTECTED] wrote: > How can I figure out the largest long available? I was hoping for > something like sys.maxint, but I didn't see it. Also, can someone > point me to where I can (concisely) read about size of such types > (int, float, long). > There is no explicit (defined) limit. Th

Re: Max Long

2008-01-21 Thread [EMAIL PROTECTED]
On Jan 21, 5:36 pm, Gary Herron <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > How can I figure out the largest long available?  I was hoping for > > something like sys.maxint, but I didn't see it.  Also, can someone > > point me to where I can (concisely) read about size of such types >

Re: Trouble writing to database: RSS-reader

2008-01-21 Thread MRAB
On Jan 21, 9:15 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Arne a écrit : > > > On 21 Jan, 19:15, Bruno Desthuilliers > [EMAIL PROTECTED]> wrote: > > >> This should not prevent you from learning how to properly parse XML > >> (hint: with an XML parser). XML is *not* a line-oriented forma

problem With Psyco on Wingide mac

2008-01-21 Thread Arash Arfaee
Hello All, I am trying to use psyco with wingide on mac. when I open Mac Python shell I can import psyco, but not inside the wingide. Even python shell on wingide cannot import psyco. Can anybody help me to solvethis problem? Thanks, Arash -- http://mail.python.org/mailman/listinfo/python-list

Re: problem With Psyco on Wingide mac

2008-01-21 Thread Wingware Support
Arash Arfaee wrote: > I am trying to use psyco with wingide on mac. when I open Mac Python > shell I can import psyco, but not inside the wingide. Even python > shell on wingide cannot import psyco. > Can anybody help me to solvethis problem? I suspect Wing is finding a different Python installati

Re: Max Long

2008-01-21 Thread tjhnson
On Jan 21, 3:34 pm, Bjoern Schliessmann wrote: > [EMAIL PROTECTED] wrote: > > How can I figure out the largest long available? > > Why would you? AFAIK, longs are only limited by available memory. Indeed, as the docs pointed out. I guess I was confused by "If pylong is greater than ULONG_MAX, a

Curses and Threading

2008-01-21 Thread Brett . Friermood
I am writing a program that uses curses and threading. I am working on displaying a clock in the upper right hand corner of the screen. I have only one thread at the moment, that gets the time and displays it in curses. To make it easier to debug right now, the program starts curses in a try: claus

Re: Just for fun: Countdown numbers game solver

2008-01-21 Thread Arnaud Delobelle
On Jan 20, 5:41 pm, [EMAIL PROTECTED] wrote: > Ever since I learnt to program I've always loved writing solvers for > the Countdown numbers game problem in different languages, and so now > I'm wondering what the most elegant solution in Python is. I've tried a completely different approach, that

Re: Max Long

2008-01-21 Thread Gabriel Genellina
En Mon, 21 Jan 2008 22:02:34 -0200, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: > On Jan 21, 5:36 pm, Gary Herron <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >> > How can I figure out the largest long available?  I was hoping for >> >> There is no explicit (defined) limit.  The a

Re: Transforming ascii file (pseduo database) into proper database

2008-01-21 Thread p.
Thanks to all for the ideas. I am familiar with external sorting. Hadn't considered it though. Will definitely be giving that a go, and then merging. Again, thanks all. -- http://mail.python.org/mailman/listinfo/python-list

Re: Curses and Threading

2008-01-21 Thread Gabriel Genellina
En Mon, 21 Jan 2008 23:06:10 -0200, <[EMAIL PROTECTED]> escribió: > I am writing a program that uses curses and threading. I am working on > displaying a clock in the upper right hand corner of the screen. I > have only one thread at the moment, that gets the time and displays it > in curses. In

newbie question: On installation of additional packages to Python

2008-01-21 Thread Nasser Abbasi
hello; I have not used Python before directly, but I am interested in trying it. I've read some good things about it. ( I am mainly interested in trying it for some scientific applications and simulation.) I am running on windowz. I have downloaded and installed 2.5.1 Python. my question is o

read files

2008-01-21 Thread J. Peng
first I know this is the correct method to read and print a file: fd = open("/etc/sysctl.conf") done=0 while not done: line = fd.readline() if line == '': done = 1 else: print line, fd.close() I dont like that flag of "done",then I tried to re-write it as: fd = open

Re: read files

2008-01-21 Thread Alex Ezell
You might could do one of these two methods: fd.readlines() or: for line in fd: print line These are both from the Python tutorial found here: http://docs.python.org/tut/node9.html#SECTION00921 /alex On Jan 21, 2008 9:00 PM, J. Peng <[EMAIL PROTECTED]> wrote: > first I kno

Re: read files

2008-01-21 Thread Mel
J. Peng wrote: > first I know this is the correct method to read and print a file: > > fd = open("/etc/sysctl.conf") > done=0 > while not done: > line = fd.readline() > if line == '': > done = 1 > else: > print line, > > fd.close() > > > I dont like that flag of "don

Re: read files

2008-01-21 Thread Benjamin
On Jan 21, 9:08 pm, Mel <[EMAIL PROTECTED]> wrote: > J. Peng wrote: > > first I know this is the correct method to read and print a file: > > > fd = open("/etc/sysctl.conf") > > done=0 > > while not done: > > line = fd.readline() > > if line == '': > > done = 1 > > else: > >

pairs from a list

2008-01-21 Thread Alan Isaac
I want to generate sequential pairs from a list. Here is a way:: from itertools import izip, islice for x12 in izip(islice(x,0,None,2),islice(x,1,None,2)): print x12 (Of course the print statement is just illustrative.) What is the fastest way? (Ignore the import time.) Thanks, A

Re: pairs from a list

2008-01-21 Thread Paul Rubin
Alan Isaac <[EMAIL PROTECTED]> writes: > (Of course the print statement is just illustrative.) > What is the fastest way? (Ignore the import time.) You have to try a bunch of different ways and time them. One idea (untested): def pairs(seq): while True: yield (seq.next(), s

Re: read files

2008-01-21 Thread Steven D'Aprano
On Tue, 22 Jan 2008 11:00:53 +0800, J. Peng wrote: > first I know this is the correct method to read and print a file: > > fd = open("/etc/sysctl.conf") > done=0 > while not done: > line = fd.readline() > if line == '': > done = 1 > else: > print line, > > fd.close()

Re: read files

2008-01-21 Thread Paul Rubin
"J. Peng" <[EMAIL PROTECTED]> writes: > print line, Do you really want all the lines crunched together like that? If not, leave off the comma. > I dont like that flag of "done",then I tried to re-write it as: > > fd = open("/etc/sysctl.conf") > while line = fd.readline(): > print li

Re: read files

2008-01-21 Thread J. Peng
Thank you. That gave so much solutions. And thanks all. Steven D'Aprano 写道: > On Tue, 22 Jan 2008 11:00:53 +0800, J. Peng wrote: > >> first I know this is the correct method to read and print a file: >> >> fd = open("/etc/sysctl.conf") >> done=0 >> while not done: >> line = fd.readline() >>

Re: How to solve "TypeError: list indices must be integers".

2008-01-21 Thread 顏灝
On 1月22日, 上午3時05分, John Machin <[EMAIL PROTECTED]> wrote: > On Jan 22, 3:15 am, "顏灝" <[EMAIL PROTECTED]> wrote: > > > This is more details about my problem, which I running my py script > > for my project. Programming in pythoncard that we can develop a GUI > > based application easily. > > > I was

Re: How to solve "TypeError: list indices must be integers".

2008-01-21 Thread 顏灝
On 1月22日, 上午1時56分, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Mon, 21 Jan 2008 08:15:02 -0800 (PST), "ÃCø¯" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > I was assigned dialog.colorDialog(self) return value to a result > > object, but I suspect that result.color is

Re: pairs from a list

2008-01-21 Thread George Sakkis
On Jan 21, 10:20 pm, Alan Isaac <[EMAIL PROTECTED]> wrote: > I want to generate sequential pairs from a list. > Here is a way:: > > from itertools import izip, islice > for x12 in izip(islice(x,0,None,2),islice(x,1,None,2)): > print x12 > > (Of course the print statement is just ill

Re: pairs from a list

2008-01-21 Thread Paddy
On Jan 22, 3:20 am, Alan Isaac <[EMAIL PROTECTED]> wrote: > I want to generate sequential pairs from a list. <> > What is the fastest way? (Ignore the import time.) 1) How fast is the method you have? 2) How much faster does it need to be for your application? 3) Are their any other bottlenecks in

Re: read files

2008-01-21 Thread Gabriel Genellina
En Tue, 22 Jan 2008 02:03:10 -0200, Paul Rubin <"http://phr.cx"@NOSPAM.invalid> escribió: > "J. Peng" <[EMAIL PROTECTED]> writes: >> print line, > > Do you really want all the lines crunched together like that? If not, > leave off the comma. Remember that Python *keeps* the end-of-line

Re: newbie question: On installation of additional packages to Python

2008-01-21 Thread Gabriel Genellina
En Tue, 22 Jan 2008 00:36:34 -0200, Nasser Abbasi <[EMAIL PROTECTED]> escribió: > I am running on windowz. I have downloaded and installed 2.5.1 Python. > > my question is on installing additional packages. > > What is the easiest way to do that? I read about python 'eggs' (like jar > files for J

HTML parsing confusion

2008-01-21 Thread Alnilam
Sorry for the noob question, but I've gone through the documentation on python.org, tried some of the diveintopython and boddie's examples, and looked through some of the numerous posts in this group on the subject and I'm still rather confused. I know that there are some great tools out there for

Re: pairs from a list

2008-01-21 Thread George Sakkis
On Jan 22, 12:15 am, Paddy <[EMAIL PROTECTED]> wrote: > On Jan 22, 3:20 am, Alan Isaac <[EMAIL PROTECTED]> wrote:> I want to generate > sequential pairs from a list. > <> > > What is the fastest way? (Ignore the import time.) > > 1) How fast is the method you have? > 2) How much faster does it nee

Re: read files

2008-01-21 Thread J. Peng
Gabriel Genellina 写道: > En Tue, 22 Jan 2008 02:03:10 -0200, Paul Rubin > <"http://phr.cx"@NOSPAM.invalid> escribió: > >> "J. Peng" <[EMAIL PROTECTED]> writes: >>> print line, >> Do you really want all the lines crunched together like that? If not, >> leave off the comma. > > Remember t

Re: I don't understand what is happening in this threading code

2008-01-21 Thread Tim Roberts
Matthew Wilson <[EMAIL PROTECTED]> wrote: >In this code, I tried to kill my thread object by setting a variable on it >to False. > >Inside the run method of my thread object, it checks a different >variable. > >I've already rewritten this code to use semaphores, but I'm just curious >what is going

Re: py2exe and modules question

2008-01-21 Thread Tim Roberts
azrael <[EMAIL PROTECTED]> wrote: > >I'm working on an application and i'm having some questions. I am >working with python 2.5, numpy and PIL. does anyone know if there are >some problems while compiling the source because of the modules.. It >has to be closed source. What does that mean to you?

Calculate net transfer rate without dummy file

2008-01-21 Thread whatazor
Hi, how can I calulate transfer rate to a host , without using a file ? can ping module (written by Jeremy Hylton) be useful ? -- http://mail.python.org/mailman/listinfo/python-list

Electronic and Computer Science video courses, No login, No fee

2008-01-21 Thread AK444
Hi Guys Good news is 23 Electronic and Computer Science video courses are free, No login, No fee. All you need to have is real player installed on your PC. Electronics is at http://freevideolectures.com/electronics/circuits_and_electronics.php Computer Science is at http://freevideolectu

Re: pairs from a list

2008-01-21 Thread Steven D'Aprano
On Mon, 21 Jan 2008 21:34:28 -0800, George Sakkis wrote: > I believe the "what is the fastest way" question for such small well- > defined tasks is worth asking on its own, regardless of whether it makes > a difference in the application (or even if there is no application to > begin with). Just b

Re: pairs from a list

2008-01-21 Thread Arnaud Delobelle
On Jan 22, 3:20 am, Alan Isaac <[EMAIL PROTECTED]> wrote: > I want to generate sequential pairs from a list. > Here is a way:: > >     from itertools import izip, islice >     for x12 in izip(islice(x,0,None,2),islice(x,1,None,2)): >         print x12 > > (Of course the print statement is just illu

Re: Boa constructor debugging - exec some code at breakpoint?

2008-01-21 Thread Joel
Can you please tell me how this can be done.. are there any other IDEs for the same purpose if Boa can't do it? Joel On Jan 6, 11:01 am, Joel <[EMAIL PROTECTED]> wrote: > Hey there.. > I'm using boa constructor to debug a python application. For my > application, I need to insert break points and

what's this instance?

2008-01-21 Thread J. Peng
def safe_float(object): try: retval = float(object) except (ValueError, TypeError), oops: retval = str(oops) return retval x=safe_float([1,2,3,4]) print x The code above works well.But what's the instance of "oops"? where is it coming from? I'm totally confused on it.thanks. -- ht

<    1   2