Re: Newbie Question

2005-08-19 Thread Gabriel Cooper
look into the csv module. (for comma-separated-value text files.) Tom Strickland wrote: I have a file that contains many lines, each of which consists of a string of comma-separated variables, mostly floats but some strings. Each line looks like an obvious tuple to me. How do I save each line

Better access to database search results

2005-04-12 Thread Gabriel Cooper
Usually when I access db search results it's something like this: cursor.execute(select A1,A2,A3,A4 from B where C) for (a1,a2,a3,a4) in cursor.fetchall(): stuff() But sometimes the point at which I use the data returned is not with the search, and so having the ability to access the results

Re: Better access to database search results

2005-04-12 Thread Gabriel Cooper
Simon Brunning wrote: On Apr 12, 2005 4:32 PM, Gabriel Cooper [EMAIL PROTECTED] wrote: Usually when I access db search results it's something like this: cursor.execute("select A1,A2,A3,A4 from B where C") for (a1,a2,a3,a4) in cursor.fetchall(): stuff() But

Re: Pseudocode in the wikipedia

2005-04-01 Thread Gabriel Cooper
Ron_Adam wrote: To me := could mean to create a copy of an object... or should it be =: ? Or how about :=) to mean is equal and :=( to mean it's not. Then there is ;=), to indicate 'True', and ':=O' to indicate 'False' Not to mention (_ | _) for asserts! --

Re: FW: Python help group

2005-03-22 Thread Gabriel Cooper
I would recommend looking into sorting like objects with the __getitem__ method. http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/b2d0580792b94a7/a707054ec3302a6e has a lively discussion on this topic. Search google for "__getitem__" and "sort" for more

Re: update images inside a mysql database

2005-02-24 Thread Gabriel Cooper
Jonas Meurer wrote: def i_update(image, imgid): image = %s % (image) sql_exec = UPDATE Images SET Image='%s' WHERE ImgID = '%s' % (image, imgid) o = open(/tmp/file.jpg, w) o.write(image) o.close() db_connect.cursor.execute(sql_exec) I've

Re: Python UPS / FedEx Shipping Module

2005-02-15 Thread Gabriel Cooper
Tom Willis wrote: On one hand you are helping them indirectly sell their services, On the other, you are sort of competing with them, so, those companies have plenty of reason to screw with you by changing the specs, lot's of hoops to jump through to contiuously be certified. Well before we make

Re: Python UPS / FedEx Shipping Module

2005-02-14 Thread Gabriel Cooper
Tom Willis wrote: Are the modules just accessing the published apis for their webservices? I'm just wondering because I used to work for a logistics mgmt company that paid money to be a strategic partner with FedEx/UPS/Airborn etc so that they could information on how to return rates/print

Python UPS / FedEx Shipping Module

2005-02-11 Thread Gabriel Cooper
I've made UPS and FedEx shipping rate request modules in python using XML. Is there an interest in putting this on the web? -- http://mail.python.org/mailman/listinfo/python-list

Re: bytecode obfuscation

2005-02-04 Thread Gabriel Cooper
snacktime wrote: Also, I'm curious how much demand their is for this application in the Python world. The application replaces online credit card processors(Verisign, Authorizenet) by providing a platform that connects directly to the bank networks for credit card processing, and also provides

Re: Remove HTML tags (except anchor tag) from a string using regular expressions

2005-02-02 Thread Gabriel Cooper
Max M wrote: If it's not to learn, and you simply want it to work, try out this library: http://zope.org/Members/chrisw/StripOGram/readme stripogram.html2safehtml('''first last''',valid_tags=('i','a','br')) 'first last' stripogram.html2safehtml('''first last''',valid_tags=('i','a','br'))

Finding a script's home directory?

2005-01-24 Thread Gabriel Cooper
In one of my python programs has a data file I need to load. My solution was to say: if os.path.exists(os.path.join(os.getcwd(), config.xml)): self.cfgfile = os.path.join(os.getcwd(), config.xml) Which works fine... as long as you're *in* the script's home directory when you

Re: Time Difference

2004-12-20 Thread Gabriel Cooper
GMane Python wrote: Hello I was wondering if there is an existing function that would let me determine the difference in time. For a more robust solution, checkout Python's profile module. http://docs.python.org/lib/profile.html -- http://mail.python.org/mailman/listinfo/python-list