Re: [Tutor] PYTHON ON DOS

2008-11-14 Thread Alan Gauld
"Lie Ryan" <[EMAIL PROTECTED]> wrote strictly speaking Windows doesn't have true DOS since NT-family. The black window is a command prompt, somewhat an emulator for DOS. Being picky CMD is an enhanced version of the DOS COMMAND program. It doesn't emulate DOS as such but it runs a backwardly

Re: [Tutor] PYTHON ON DOS

2008-11-14 Thread Alan Gauld
"WM." <[EMAIL PROTECTED]> wrote Some say that Python programs run better on DOS. What they mean is running python scripts within a command window (aka DOS box). (You can run Python under real 16 bit DOS but its slow and clunky, don't do it unless you really must!) You can start a comma

Re: [Tutor] PYTHON ON DOS

2008-11-14 Thread Kent Johnson
On Fri, Nov 14, 2008 at 1:27 PM, WM. <[EMAIL PROTECTED]> wrote: > Some say that Python programs run better on DOS. I cannot find a way to do > that. I can go 'Python Command Line' to wind up on a black screen version > of IDLE but I can't get from the interactive to executive mode. > > Is there a

Re: [Tutor] pygame1.py

2008-11-14 Thread Kent Johnson
On Fri, Nov 14, 2008 at 1:11 PM, Ifeozor, Humphrey O. <[EMAIL PROTECTED]> wrote: > Dear Tutor, > > I have problem runing the attached pygame code, there's been error message > "could not open ("ball.bmp")". what do i need to make it run as expected or > how do i import the library which contains "b

[Tutor] problem running iptest on windows

2008-11-14 Thread Mary Lou Knack
Hi I just installed Ipython 0.9.1.win32 (and Python 2.5.1) under Windows XP. I added C:\Python25\Scripts to my path environment variable but nothing else. Out of curiosity, I then decided to try running the iptest script (after installing the nose code) but I keep getting import errors. Here

Re: [Tutor] list output -- float output

2008-11-14 Thread spir
Thank you for the advice. Actually, what annoys me is that list textual output, either with print or str(), calls repr() for each item of the list, instead of str(). That's why I had these strange things with floats, as illustrated in my first post on the topic: class Seq(list): ''' se

Re: [Tutor] PYTHON ON DOS

2008-11-14 Thread Lie Ryan
On Fri, 14 Nov 2008 10:27:59 -0800, WM. wrote: > Some say that Python programs run better on DOS. I cannot find a way to > do that. I can go 'Python Command Line' to wind up on a black screen > version of IDLE but I can't get from the interactive to executive mode. > > Is there any advantage to

Re: [Tutor] pygame1.py

2008-11-14 Thread bob gailer
Ifeozor, Humphrey O. wrote: Dear Tutor, I have problem runing the attached pygame code, there's been error message "could not open ("ball.bmp")". what do i need to make it run as expected or how do i import the library which contains "ball.bmp" I have no way to view that attachment. Please ju

[Tutor] PYTHON ON DOS

2008-11-14 Thread WM.
Some say that Python programs run better on DOS. I cannot find a way to do that. I can go 'Python Command Line' to wind up on a black screen version of IDLE but I can't get from the interactive to executive mode. Is there any advantage to running .py on DOS? __

[Tutor] pygame1.py

2008-11-14 Thread Ifeozor, Humphrey O.
Dear Tutor, I have problem runing the attached pygame code, there's been error message "could not open ("ball.bmp")". what do i need to make it run as expected or how do i import the library which contains "ball.bmp" thank you for your help. Humphrey -- Scanned by iCritical. import pyg

Re: [Tutor] list output -- float output

2008-11-14 Thread Lie Ryan
On Fri, 14 Nov 2008 15:21:17 +0100, spir wrote: > Well, actually not really I guess. I asked for rounded floats, not > full-precision ones. > Now, after more reflexion on the topic, I understand that even rounded > floats need to keep full precision internally, because of the 'modular' > difference

Re: [Tutor] Classes and Databases

2008-11-14 Thread Jojo Mwebaze
Sorry Alan, What u described below is exactly what i want to do.. if given x, y as two datatums and such that f(x) --> y, given y can we determine f or x? Assuming the x, y and f are stored in the database, then we can be able to write queries to search/extract for the f's that are responsible f

Re: [Tutor] floating point accuracy [working with Fractions]

2008-11-14 Thread Kent Johnson
On Fri, Nov 14, 2008 at 3:39 AM, Karen Bester <[EMAIL PROTECTED]> wrote: > Hi > > Is there a method to determine the accuracy that you can get given a double > precision number. I'm looking for a formula or table that can tell me what > accuracy I can get depending on "where" the decimal point lie

Re: [Tutor] floating point accuracy [working with Fractions]

2008-11-14 Thread bob gailer
Karen Bester wrote: Hi Is there a method to determine the accuracy that you can get given a double precision number. I'm looking for a formula or table that can tell me what accuracy I can get depending on "where" the decimal point lies. What do you mean by "accuracy"? How do you measure

Re: [Tutor] referencing external functions

2008-11-14 Thread DIAGORN Geneviève
At the beginning of script2.py, write: >From script1 import , ..., Sincerely, Geneviève _ De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Robert Berman Envoyé : vendredi 14 novembre 2008 13:57 À : [tutor python] Objet : [Tutor] referencing external functions I ha

Re: [Tutor] list output -- float output

2008-11-14 Thread spir
A.T.Hofkamp a écrit : > spir wrote: >> # By the way, I do not understand at all the behaviour of repr on >> rounded floats: >> x = round(1.1,1) >> print x, repr(x), "%s" %x >> 1.1 1.1001 1.1 > > This is a FAQ question: > > http://www.python.org/doc/faq/general/#why-are-floating-point-

Re: [Tutor] referencing external functions

2008-11-14 Thread Robert Berman
bob gailer wrote: A.T.Hofkamp wrote: (I would suggest to use more meaningful names than scriptX.py) Perhaps Robert uses (as I do) Python for Windows. "Save" proposes script1, script2, ... as the initial filename. WIBNI it could cleverly guess a meaningful name as

Re: [Tutor] list output -- float output

2008-11-14 Thread spir
[addendum] Well, actually, the previous Seq didn't solve all problems. Obvious case of nested lists. Below a modified version. denis class Seq(list): ''' specialized sequence type with improved str Override list's behaviour that str(list) calls repr instead of str on it

Re: [Tutor] referencing external functions

2008-11-14 Thread Kent Johnson
On Fri, Nov 14, 2008 at 7:56 AM, Robert Berman <[EMAIL PROTECTED]> wrote: > I have a number of functions written in a python script called script1.py. > In another script, script2.py, I need to use a number of the functions > residing in script1.py. How do I make these functions known to script2.p

Re: [Tutor] referencing external functions

2008-11-14 Thread bob gailer
A.T.Hofkamp wrote: Robert Berman wrote: I have a number of functions written in a python script called script1.py. In another script, script2.py, I need to use a number of the functions residing in script1.py. How do I make these functions known to script2.py. Thank you, script1.py: def

Re: [Tutor] referencing external functions

2008-11-14 Thread A.T.Hofkamp
Robert Berman wrote: I have a number of functions written in a python script called script1.py. In another script, script2.py, I need to use a number of the functions residing in script1.py. How do I make these functions known to script2.py. Thank you, script1.py: def f(n): return n + 1

[Tutor] floating point accuracy [working with Fractions]

2008-11-14 Thread Karen Bester
Hi Is there a method to determine the accuracy that you can get given a double precision number. I'm looking for a formula or table that can tell me what accuracy I can get depending on "where" the decimal point lies. Thank you Karen _

[Tutor] referencing external functions

2008-11-14 Thread Robert Berman
I have a number of functions written in a python script called script1.py. In another  script, script2.py, I need to use a number of the functions residing in script1.py. How do I make these functions known to script2.py. Thank you, Robert ___ Tu

Re: [Tutor] list output -- float output

2008-11-14 Thread A.T.Hofkamp
spir wrote: # By the way, I do not understand at all the behaviour of repr on rounded floats: x = round(1.1,1) print x, repr(x), "%s" %x 1.1 1.1001 1.1 This is a FAQ question: http://www.python.org/doc/faq/general/#why-are-floating-point-calculations-so-inaccurate Sincerely, Albe

[Tutor] list output -- float output

2008-11-14 Thread spir
Below an illustration of what troubles me a bit. denis class Seq(list): ''' specialized sequence type with improved str Override list's behaviour that list.__str__ calls __repr__ instead of __str__ on items. ??? ''' def __str__(self):