Re: [Tutor] Looking to improve my stopWatch.py

2007-10-24 Thread Dick Moores
At 09:41 PM 10/24/2007, John Fouhy wrote: On 25/10/2007, Dick Moores <[EMAIL PROTECTED]> wrote: >  I'm wondering about "if lapTimeFlag:". Following "The Zen of Python", by > Tim Peters ("Explicit is better than implicit"), isn't "if lapTimeFlag == > True" preferable? No :-) Otherwise, maybe we sh

Re: [Tutor] where is the function from

2007-10-24 Thread Eric Brunson
linda.s wrote: > How can I know where a function such as abc is from (from which module)? > abc > > You could: 1. look it up in the index of the library reference (http://www.python.org/doc/current/lib/genindex.html), 2. try "pydoc", 3. examine abc.__modul

[Tutor] underlying C/C++ object has been deleted

2007-10-24 Thread Lawrence Shafer
I am trying to convert a program with hand coded QT over to using UI files from QT Designer. I am getting the error below and do not understand what's going on. I have a feeling I need to add self. to something in here, but I'm not sure what. Is this enough code for you to see whats going on??

[Tutor] where is the function from

2007-10-24 Thread linda.s
How can I know where a function such as abc is from (from which module)? >>> abc ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Looking to improve my stopWatch.py

2007-10-24 Thread John Fouhy
On 25/10/2007, Dick Moores <[EMAIL PROTECTED]> wrote: > I'm wondering about "if lapTimeFlag:". Following "The Zen of Python", by > Tim Peters ("Explicit is better than implicit"), isn't "if lapTimeFlag == > True" preferable? No :-) Otherwise, maybe we should make it even more explicit: if (la

Re: [Tutor] Looking to improve my stopWatch.py

2007-10-24 Thread Dick Moores
At 02:14 PM 10/24/2007, bob gailer wrote: Dick Moores wrote: Please give me constructive criticism of < http://www.rcblue.com/Python/stopWatchForWeb14-a.py>   1 - lapCounter is not used. Deleted. 2 - simplify:    if lapTimeFlag == False:    print "Total Time is", secs

Re: [Tutor] trouble with if

2007-10-24 Thread John Fouhy
On 25/10/2007, Bryan Fodness <[EMAIL PROTECTED]> wrote: > I have the following code, it keeps giving me a value of 1 for e. > > for line in file('21Ex6MV_oaf.dat'): > oa, openoa, w15, w30, w45, w60 = line.split() > if (float(oa) == round(offaxis)) and (eff_depth < 10 and unblockedFS > > 15)

[Tutor] trouble with if

2007-10-24 Thread Bryan Fodness
I have the following code, it keeps giving me a value of 1 for e. for line in file('21Ex6MV_oaf.dat'): oa, openoa, w15, w30, w45, w60 = line.split() if (float(oa) == round(offaxis)) and (eff_depth < 10 and unblockedFS > 15): e = float(openoa) else: e = 1 If I comment o

Re: [Tutor] Looking to improve my stopWatch.py

2007-10-24 Thread bhaaluu
On 10/24/07, Alan Gauld <[EMAIL PROTECTED]> wrote: > > "bhaaluu" <[EMAIL PROTECTED]> wrote > > import msvcrt > > Traceback (most recent call last): > > File "", line 1, in ? > > ImportError: No module named msvcrt > > > You are on Linux so you'll need to port it to use curses instead of

Re: [Tutor] Looking to improve my stopWatch.py

2007-10-24 Thread Alan Gauld
"bhaaluu" <[EMAIL PROTECTED]> wrote import msvcrt > Traceback (most recent call last): > File "", line 1, in ? > ImportError: No module named msvcrt You are on Linux so you'll need to port it to use curses instead of msvcrt... Alan G __

Re: [Tutor] Calling a Method with a Reserved Name

2007-10-24 Thread Alex Ezell
On 10/24/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > Alex Ezell wrote: > > ># TODO figure out how to call this soap method with reserved name > >self.call_response = self.soap.import(self.soap_auth, > > file_name, import_groups, soap_flags) > > > I tried to replace the imp

Re: [Tutor] Calling a Method with a Reserved Name

2007-10-24 Thread Kent Johnson
Alex Ezell wrote: ># TODO figure out how to call this soap method with reserved name >self.call_response = self.soap.import(self.soap_auth, > file_name, import_groups, soap_flags) > I tried to replace the import() call with these two lines: > importFunc = getattr(self.soap

Re: [Tutor] Calling a Method with a Reserved Name

2007-10-24 Thread Alex Ezell
Oops, meant to send to the list. Sorry, Kent. > > > >>> I am working on building a SOAP client. Unfortunately, one of the > > > >>> methods the SOAP server provides is named "import." The SOAP server is > > > >>> written in PHP. > > > >>> > > > >>> So, my problem is that Python really doesn't like

Re: [Tutor] Looking to improve my stopWatch.py

2007-10-24 Thread bob gailer
Dick Moores wrote: > Please give me constructive criticism of > > 1 - lapCounter is not used. 2 - simplify: if lapTimeFlag == False: print "Total Time is", secsToHMS(totalTime) print

Re: [Tutor] Calling a Method with a Reserved Name

2007-10-24 Thread Eric Brunson
bob gailer wrote: > Alex Ezell wrote: > >> I am working on building a SOAP client. Unfortunately, one of the >> methods the SOAP server provides is named "import." The SOAP server is >> written in PHP. >> >> So, my problem is that Python really doesn't like me using the word >> "import" to call

Re: [Tutor] Calling a Method with a Reserved Name

2007-10-24 Thread Kent Johnson
Alex Ezell wrote: > On 10/24/07, Kent Johnson <[EMAIL PROTECTED]> wrote: >> Alex Ezell wrote: >>> I am working on building a SOAP client. Unfortunately, one of the >>> methods the SOAP server provides is named "import." The SOAP server is >>> written in PHP. >>> >>> So, my problem is that Python re

Re: [Tutor] Calling a Method with a Reserved Name

2007-10-24 Thread Kent Johnson
Alex Ezell wrote: >> You could try introspection: >> >> importFunc = getattr(self.soap, 'import') >> self.call_response = importFunc(self.soap_auth, file_name, >> import_groups, soap_flags) > > Thanks Kent. I tried it and it seem like importFunc is now something > like 'import.__str__'. I could ma

Re: [Tutor] Calling a Method with a Reserved Name

2007-10-24 Thread bob gailer
Alex Ezell wrote: > I am working on building a SOAP client. Unfortunately, one of the > methods the SOAP server provides is named "import." The SOAP server is > written in PHP. > > So, my problem is that Python really doesn't like me using the word > "import" to call the SOAP method. This seems un

Re: [Tutor] Calling a Method with a Reserved Name

2007-10-24 Thread Alex Ezell
On 10/24/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > Alex Ezell wrote: > > I am working on building a SOAP client. Unfortunately, one of the > > methods the SOAP server provides is named "import." The SOAP server is > > written in PHP. > > > > So, my problem is that Python really doesn't like me

Re: [Tutor] Calling a Method with a Reserved Name

2007-10-24 Thread Kent Johnson
Alex Ezell wrote: > I am working on building a SOAP client. Unfortunately, one of the > methods the SOAP server provides is named "import." The SOAP server is > written in PHP. > > So, my problem is that Python really doesn't like me using the word > "import" to call the SOAP method. The call shou

[Tutor] Calling a Method with a Reserved Name

2007-10-24 Thread Alex Ezell
I am working on building a SOAP client. Unfortunately, one of the methods the SOAP server provides is named "import." The SOAP server is written in PHP. So, my problem is that Python really doesn't like me using the word "import" to call the SOAP method. The call should look something like this:

Re: [Tutor] Looking to improve my stopWatch.py

2007-10-24 Thread bhaaluu
On 10/24/07, Dick Moores <[EMAIL PROTECTED]> wrote: > Please give me constructive criticism of > $ python Python 2.4.3 (#2, Oct 6 2006, 07:52:30) [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2 Type "help", "copyright", "credits" or "license" fo

[Tutor] Looking to improve my stopWatch.py

2007-10-24 Thread Dick Moores
Please give me constructive criticism of (secsToHMS() was perfected with much Tutor help in this thread: ) Thanks, Dick Moores 44 __

Re: [Tutor] Logging in Linux

2007-10-24 Thread Noufal Ibrahim
wormwood_3 wrote: > Now, what I would like to do is instead send this output to one or > more of the standard linux log files. First though, I am wondering, what > is the standard procedure in a case like this? You can either have a config file to specify a log area or use syslog to do the logg

Re: [Tutor] calling a variable name

2007-10-24 Thread Kent Johnson
Dave Kuhlman wrote: > On Tue, Oct 23, 2007 at 10:10:24PM -0400, Kent Johnson wrote: > > [snip] > >> Perhaps I was a bit hasty. >> >> Lists are implemented as arrays of references. I believe they are >> - amortized O(1) for append - occasionally the list must be reallocated >> and copied > > OK.