Re: [Tutor] Dynamic Method Creation

2008-07-10 Thread Chris Fuller
On Thursday 10 July 2008 09:09, George Flaherty wrote: > Hello, > > I am trying to port over some old code from Ruby into Python. In my old > ruby code I had a UnitTest class that created a bunch of test methods (i.e. > def test_MyTestFunction) dynamically through the ruby method > define_method(h

[Tutor] function for memory usage

2008-07-10 Thread Yuanxin Xi
Hi, Could anyone please tell me which funtion (or which module) could return the total memory used by current python program? Thanks, Fred ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Float number accuracy

2008-07-10 Thread Julia
On Thu, Jul 10, 2008 at 11:21 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > On Thu, Jul 10, 2008 at 4:41 PM, Julia <[EMAIL PROTECTED]> wrote: > > I've done this: > > > c = float > c > > > > This is not needed, Python variables do not have types (it is the > values that have type). > >

Re: [Tutor] Float number accuracy

2008-07-10 Thread Kent Johnson
On Thu, Jul 10, 2008 at 4:41 PM, Julia <[EMAIL PROTECTED]> wrote: > I've done this: > c = float c > This is not needed, Python variables do not have types (it is the values that have type). c = 3.3 c > 3.2998 > > I've done it with and without the c = float and sti

Re: [Tutor] Float number accuracy

2008-07-10 Thread Michiel Overtoom
On 10-jul-2008, at 22:41, Julia wrote: >>> c = 3.3 >>> c 3.2998 I've done it with and without the c = float and still it rounds the number down. Why? And more importantly: is it possible to make Python more accurate? I need the exact number and not something close to it for

[Tutor] Float number accuracy

2008-07-10 Thread Julia
I've done this: >>> c = float >>> c >>> c = 3.3 >>> c 3.2998 I've done it with and without the c = float and still it rounds the number down. Why? And more importantly: is it possible to make Python more accurate? I need the exact number and not something close to it for my new appli

Re: [Tutor] Dynamic Method Creation

2008-07-10 Thread Alan Gauld
"George Flaherty" <[EMAIL PROTECTED]> wrote ) dynamically through the ruby method define_method(http://www.ruby- doc.org/core/classes/Module.html#M000396). > This functionally allowed me to create any number of methods dynamically within a particular class. I am pretty sure python can handl

Re: [Tutor] Looking for IEEE "double-precision" library

2008-07-10 Thread Kent Johnson
On Thu, Jul 10, 2008 at 11:48 AM, Tse, William: #CIPO - OPIC <[EMAIL PROTECTED]> wrote: > Can anyone tell me where I can download the latest version of the fpconst.py > library ? I find two locations, they appear to be the same: http://pypi.python.org/pypi/fpconst/ http://bugs.python.org/issue1151

Re: [Tutor] Dynamic Method Creation

2008-07-10 Thread bob gailer
George Flaherty wrote: Hello, I am trying to port over some old code from Ruby into Python. In my old ruby code I had a UnitTest class that created a bunch of test methods (i.e. def test_MyTestFunction) dynamically through the ruby method define_method(http://www.ruby-doc.org/core/classes/Mo

[Tutor] Looking for IEEE "double-precision" library

2008-07-10 Thread Tse, William: #CIPO - OPIC
Can anyone tell me where I can download the latest version of the fpconst.py library ? This library has a set of constants/functions for working with IEEE754 double-precision special values and provides support for SOAP datatype specification. There are older links to the fpconst library that no

[Tutor] Dynamic Method Creation

2008-07-10 Thread George Flaherty
Hello, I am trying to port over some old code from Ruby into Python. In my old ruby code I had a UnitTest class that created a bunch of test methods (i.e. def test_MyTestFunction) dynamically through the ruby method define_method(http://www.ruby-doc.org/core/classes/Module.html#M000396). This

Re: [Tutor] Basic Help Implementing Saved Scripts

2008-07-10 Thread Alan Gauld
<[EMAIL PROTECTED]> wrote in message The idea is that I want to make a few functions and be able to pull them up within my program without copy and pasting them. Is it possible in Python? Do I have to import them? Yes, you create a module and import the module. I've tried looking at tutoria

Re: [Tutor] python beginner

2008-07-10 Thread Alan Gauld
"Fred @ Mac" <[EMAIL PROTECTED]> wrote Of course to do all of this, it will also need an interface. I'm not too sure what you mean by an "interface"? Do you mean a user interface? It will certainly need one of those but it could be a command line UI or a text based UI or a GUI or a Web UI. Or

Re: [Tutor] build list of non-empty variables

2008-07-10 Thread Tim Golden
Alan Gauld wrote: "Tim Golden" <[EMAIL PROTECTED]> wrote In fact I guess you could say that the new definition of a list comprehension is [ generator expression] Well, not if sure if you meant that literally No I meant in syntactic terms. I imagined that that was what you meant. I think