Re: [Tutor] decimal floating point?

2006-05-02 Thread Andre Engels
You can use string formatting here: Je Body Mass Index is %.1f%gewicht/lengte**2 Actually, I'm not sure this word work correctly. Better: Je Body Mass Index is %.1f%(gewicht/lengte**2) that should definitely owrk -- Andre Engels, [EMAIL PROTECTED] ICQ: 6260644 -- Skype: a_engels

Re: [Tutor] decimal floating point?

2006-05-02 Thread Yi Qiang
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 michel maho wrote, On 05/02/2006 07:33 AM: To all I have the following calculation: Je Body Mass Index is,gewicht/lengte**2 The result is a (digital?)floating point figure with with 10 decimal numbers. For = example

[Tutor] question about run time

2006-05-02 Thread Ertl, John
I have been using python for sometime...and occasionally I noticed significant delay before the code would run but unitl now I have been able to write it off to other things. Now I have a short script that I wrote to check some files and print out a few lines. I have noticed that usually the

Re: [Tutor] question about run time

2006-05-02 Thread Kent Johnson
Ertl, John wrote: I have been using python for sometime...and occasionally I noticed significant delay before the code would run but unitl now I have been able to write it off to other things. Now I have a short script that I wrote to check some files and print out a few lines. I have

Re: [Tutor] question about run time

2006-05-02 Thread Ertl, John
Kent, The files are very small (a few hundred lines). Maybe it is a network issue? But then why is it always slow the first time in the morning? I don't know network stuff but that seams a bit strange. Thanks, John Ertl -Original Message- From: Kent Johnson [mailto:[EMAIL

Re: [Tutor] question about run time

2006-05-02 Thread Kent Johnson
Ertl, John wrote: Kent, The files are very small (a few hundred lines). Maybe it is a network issue? But then why is it always slow the first time in the morning? I don't know network stuff but that seams a bit strange. Maybe the network access is slow and the files are cached locally

Re: [Tutor] question about run time

2006-05-02 Thread Ertl, John
Kent, I will check with the systems guys...and the Perl guys down the hall to see if they have the same problem. Thanks for the help. John Ertl -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kent Johnson Sent: Tuesday, May 02, 2006 12:27 PM

Re: [Tutor] question about run time

2006-05-02 Thread Danny Yoo
I have been using python for sometime...and occasionally I noticed significant delay before the code would run but unitl now I have been able to write it off to other things. Now I have a short script that I wrote to check some files and print out a few lines. I have noticed that

Re: [Tutor] question about run time

2006-05-02 Thread Ertl, John
Danny, What is the best way to track the time uses in I/O and CPU. Here is the code. It checks some text files for a user name and collects memory and inode usage then adds them together and checks against a set limit...if the limit is reached it calls a mail script to send an email warning.

Re: [Tutor] question about run time

2006-05-02 Thread Danny Yoo
Hi John, You can try something like the profiler, which will say where most of the program's time is being spent. We can find documentation on the Python profiler here: http://www.python.org/doc/lib/profile.html From a rough, low-level standpoint, there are tools like 'top' on Linux

[Tutor] simple question about numeric types

2006-05-02 Thread Gregor Lingl
Hi! Is there a simpler/fster way to check if a value has int or float type (i.e. is a real number) than: v=some numeric value if isinstance(v, int) or isinstance(v, float): block (v must not be complex) Regards, Gregor -- Gregor Lingl Reisnerstrasse 3/19 A-1030 Wien Telefon: +43 1

Re: [Tutor] simple question about numeric types

2006-05-02 Thread John Fouhy
On 03/05/06, Gregor Lingl [EMAIL PROTECTED] wrote: Hi! Is there a simpler/fster way to check if a value has int or float type (i.e. is a real number) than: v=some numeric value if isinstance(v, int) or isinstance(v, float): block (v must not be complex) Well, for one, you can

[Tutor] counting number of inputs

2006-05-02 Thread MICHELLE EVANS
I am trying to count the number of times a positive number is entered from the user. But, the program must stop after 5 user inputs or a negative number. Can anyone help. Rick ___ Tutor maillist - Tutor@python.org

Re: [Tutor] counting number of inputs

2006-05-02 Thread Python
On Tue, 2006-05-02 at 19:25 -0400, MICHELLE EVANS wrote: I am trying to count the number of times a positive number is entered from the user. But, the program must stop after 5 user inputs or a negative number. Can anyone help. Yes, but you need to help yourself also. Do you know how to

Re: [Tutor] counting number of inputs

2006-05-02 Thread Danny Yoo
On Tue, 2 May 2006, MICHELLE EVANS wrote: I am trying to count the number of times a positive number is entered from the user. But, the program must stop after 5 user inputs or a negative number. That seems like a really arbitrary and silly thing to do, but ok. So... what question do