Accessing function in a module by name

2007-06-06 Thread Tobiah
Is there a way to call function in an imported module having only the name? func_name = 'doit' real_func = foo.some_magic(func_name) #Now call it real_func(args) I'm trying to set up a function dispatcher for a SOAP server. Thanks, Tobiah -- Posted via a free Usenet account from http://ww

Re: Accessing function in a module by name

2007-06-06 Thread imho
Tobiah ha scritto: > Is there a way to call function in an imported > module having only the name? > > > func_name = 'doit' > > real_func = foo.some_magic(func_name) > > #Now call it > real_func(args) > > > I'm trying to set up a function dispatcher for a > SOAP server. > > Thanks, > > Tobi

Re: Accessing function in a module by name

2007-06-06 Thread John Machin
On Jun 7, 8:13 am, Tobiah <[EMAIL PROTECTED]> wrote: > Is there a way to call function in an imported > module having only the name? > > func_name = 'doit' > > real_func = foo.some_magic(func_name) Presuming 'foo' is the name of the module: real_func = getattr(foo, func_name) > > #Now call it >

Re: Accessing function in a module by name

2007-06-06 Thread Tobiah
> What's wrong with real_func = getattr(foo, func_name) ? Maybe I > misunderstood your question ? Nothing, it just didn't exist in my mind until now. Thanks -- Posted via a free Usenet account from http://www.teranews.com -- http://mail.python.org/mailman/listinfo/python-list

Some questions about ipath error messages

2007-06-06 Thread Mitko Haralanov
Hi Dave, I have some questions about the ipath error messages that we print out. I am currently testing the error injection part of the matrix and I starting with "incorrect checksum" and "incorrect HW version". I have set the debug level on both machines to 0x83 and I am monitoring ipathstats. I

Re: get message form ie

2007-06-06 Thread John J. Lee
Ashok <[EMAIL PROTECTED]> writes: > Hi, > > Is there any way i can get a message form internet explorer into my > python script when internet explorer completes loading a page? > > _ > ashok One way is to use a Browser Helper Object (BHO). Here's an old script written for old version of ct

Re: creating lists based on parsed items

2007-06-06 Thread Basilisk96
> If you are using Python 2.5, use a defaultdict instead, the very first > example looks like what you want. > > > -- > Gabriel Genellina Uh-oh.. I am using Python 2.5 on WinXP, but when I tried the examples in the manual, I got a "NameError: n

Re: MySQL InterfaceError

2007-06-06 Thread kaens
On 6/5/07, Joe <[EMAIL PROTECTED]> wrote: > > > > > >File "build/bdist.linux-i686/egg/MySQLdb/cursors.py", line > 147, in execute > > >charset = db.character_set_name() > > > > > >InterfaceError: (0, '') > > > > We got it working. It was caused by passing a database connection to a > module: >

Re: lists - append - unique and sorted

2007-06-06 Thread Steve Howell
--- Neil Cerutti <[EMAIL PROTECTED]> wrote: > i agree that using bisect and inserting manually > clearly meets > the stated requirements, while there isn't enough > information to > know if a heapq will meet his requirements. > > Thanks for the correction. > If the OP is still reading, don't di

Copy a file from PDA

2007-06-06 Thread Tempo
Are there libraries out there that will assist me in copying a file from my Dell Axim PDA (Windows Mobile) and putting the copy onto my desktop (Windows XP)? Thanks so much. -- http://mail.python.org/mailman/listinfo/python-list

Re: creating lists based on parsed items

2007-06-06 Thread Steven D'Aprano
On Wed, 06 Jun 2007 22:49:27 +, Basilisk96 wrote: >> If you are using Python 2.5, use a defaultdict instead, the very first >> example looks like what you want. >> >> >> -- >> Gabriel Genellina > > Uh-oh.. > I am using Python 2.5 on WinXP,

Re: Determinant of Large Matrix

2007-06-06 Thread Steven D'Aprano
On Wed, 06 Jun 2007 04:10:43 -0700, James Stroud wrote: > Hello All, > > I'm using numpy to calculate determinants of matrices that look like > this (13x13): [snip matrix] > For this matrix, I'm getting this with numpy: > > 2774532095.971 > > But I have a feeling I'm exceeding the capa

Re: Determinant of Large Matrix

2007-06-06 Thread James Stroud
Hello, Thank you to those who responded for your answers. They were very helpful and I'm confident now that numpy is calculating accurate determinants for these matrices. But I think I need to restate my problem a little as suggested by some becuase I'm still bewildered. First, here is the re

Re: Determinant of Large Matrix

2007-06-06 Thread James Stroud
Steven D'Aprano wrote: [Valuable Response] Thank you Steven for your helpful comments. Please see my reply to Bjoern Schliessmann where I have restated my problem. James -- http://mail.python.org/mailman/listinfo/python-list

Re: Determinant of Large Matrix

2007-06-06 Thread James Stroud
James Stroud wrote: [pointless stuff] OK. Nevermind. I'm rebinding encodings and so taking a sample from the sample and thus getting the sample back. Terribly sorry. James -- http://mail.python.org/mailman/listinfo/python-list

Re: creating lists based on parsed items

2007-06-06 Thread Basilisk96
> This would be a RTFM moment :) defaultdict is not a built-in, it is part > of the collections module. Bingo! I should have read higher up in the manual tree :) Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: lists - append - unique and sorted

2007-06-06 Thread Dan Bishop
On Jun 6, 10:26 am, rhXX <[EMAIL PROTECTED]> wrote: > hi, > > can i append a item to a list using criterias: > > - UNIQUE - if there already exist don't append > > and/or > > - SORTED - INSERT in the correct place using some criteria? > > tks in advance If you don't need the list to be sorted unti

“On Your Desktop”: the celebrity posting editorial blog

2007-06-06 Thread Steve Holden
The first post comes from Ian Bicking: http://onyourdesktop.blogspot.com/ Whose desktop would /you/ like to know about? regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://del.icio.us/steve.h

Re: Need a Little Help on Tkinter and Python

2007-06-06 Thread W. Watson
Is there a pdf file or downloadable file of the Tkinter material? I like to put stuff in notebooks. W. Watson wrote: > Thanks for your responses. I've located the URL from the post above and > will check out the two books mentioned here. I used to do a lot of > scientific programming, but now j

Splitting SAX results

2007-06-06 Thread IamIan
Hi list, I have a very simple SAX script from which I get results like 'Title1:Description','Title2:Description'. I want to split each result on the colon, using the two resulting elements as key/value pairs in a dictionary. I've tried a couple different approaches with lists etc, but I keep getti

Re: Accessing function in a module by name

2007-06-06 Thread John Nagle
Tobiah wrote: > Is there a way to call function in an imported > module having only the name? ... > I'm trying to set up a function dispatcher for a > SOAP server. Bad idea. This exposes all the functions of the module to calls from the outside world. Big security hole. In any case, SOA

Re: Who uses Python?

2007-06-06 Thread Hendrik van Rooyen
"Stef Mientki" <[EMAIL PROTECTED]> wrote: > I use Python as a replacement for MatLab, > and intend to use it as replacement for Delphi, AutoIt, PHP, VB. > And I'ld love to use it as a replacement for micro controller programming. If you have a little sub - 64k micro this is not really practical

Re: Python for industrial control (was: Who uses Python?)

2007-06-06 Thread Hendrik van Rooyen
"Cameron Laird" <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > > "walterbyrd" <[EMAIL PROTECTED]> wrote: > > > >> Anything else? Finance? Web-analytics? SEO? Digital art? > > > >Industrial control and alarm annunciation > . > . > . >

Re: Why Python?

2007-06-06 Thread Etienne Hilson
> > IMO Python is a powerful language and a fast-develop one. > IMO Python and java are very similar in the way that they are powerful and fast-develop one, even if java is a bit heavier to program with. But IMO the VERY goo point for python is the available graphical interfaces (Tkinter, wxPyth

Re: [pyserial - winXP] Serial port stop receiving data after a few hours, raise no error

2007-06-06 Thread Hendrik van Rooyen
<[EMAIL PROTECTED]> wrote: >Hello, > >My soft passively listen to a device sending +- 300 bytes of data each >second. After several hours of work, the soft abruptly stops receiving >data without any error, (while the device sends properly, of course) >and I need to restart it (the python soft) to

Re: ftplib error- Large file

2007-06-06 Thread Hendrik van Rooyen
<[EMAIL PROTECTED]> wrote: > Hi all, > > I'm using ftplib to transfer large files to remote sites. The process > seems to work perfectly with small files, but when the file gets to > large ~20GB I begin getting errors that sometimes seem to be non- > fatal, and other times the transfer does not

howto obtain directory where current (running) py-file is placed?

2007-06-06 Thread dmitrey
Hi all, I guess this question was asked many times before, but I don't know keywords for web search. Thank you in advance, D. -- http://mail.python.org/mailman/listinfo/python-list

Re: Splitting SAX results

2007-06-06 Thread Stefan Behnel
IamIan wrote: > I have a very simple SAX script from which I get results like > 'Title1:Description','Title2:Description'. I want to split each result > on the colon, using the two resulting elements as key/value pairs in a > dictionary. I've tried a couple different approaches with lists etc, > bu

<    1   2