Re: [Tutor] Excited about python

2011-06-12 Thread Albert-Jan Roskam
My all-time favourite is Programming in Python 3 (Mark Summerfield) http://www.qtrac.eu/py3book.html Most of it is not for absolute beginners. Some of the chapters contain stuff I still cannot wrap my brain around. I believe the chapter about regexes (which is VERY good) is freely downloadable

[Tutor] Floating Point Craziness

2011-06-12 Thread Ryan Strunk
Hi everyone, I'm designing a timeline. When the user presses the right arrow, 0.1 is added to the current position. The user can add events to the timeline, and can later scroll back across those events to see what they are. But something I absolutely don't understand is happening: I used the progr

Re: [Tutor] Floating Point Craziness

2011-06-12 Thread Brett Ritter
> dictionary = {3.1014: value, 2.1005: value, > 1.0999: value} > Why is this happening? The output is telling me 3.1, but the value isn't It's a quirk of how computers store floating point numbers. While humans mentally tend to treat everything as characters (a

Re: [Tutor] Floating Point Craziness

2011-06-12 Thread Steven D'Aprano
Ryan Strunk wrote: Hi everyone, I'm designing a timeline. When the user presses the right arrow, 0.1 is added to the current position. The user can add events to the timeline, and can later scroll back across those events to see what they are. But something I absolutely don't understand is happen

[Tutor] [OT] Re: Floating Point Craziness

2011-06-12 Thread R. Alan Monroe
> * Or you just get used to the fact that some numbers are not exact in > floating point. This got me thinking. How many decimal places do you need to accurately, say, aim a laser somewhere in a 180 degree arc accurately enough to hit a dime on the surface of the moon? Alan ___

Re: [Tutor] Lists

2011-06-12 Thread Piotr Kamiński
Dnia 11-06-2011 o 17:51:03 Piotr Kamiński napisał(a): Dnia 11-06-2011 o 17:30:50 Alan Gauld napisał(a): "Piotr Kamiński" wrote This is a *technical* list, as I understand it, solely dedicated to ... Since this seems to be something we can all agree on can we consider this discussion

Re: [Tutor] [OT] Re: Floating Point Craziness

2011-06-12 Thread Andre' Walker-Loud
Hi Alan, >> * Or you just get used to the fact that some numbers are not exact in >> floating point. > > This got me thinking. How many decimal places do you need to > accurately, say, aim a laser somewhere in a 180 degree arc accurately > enough to hit a dime on the surface of the moon? Here i

Re: [Tutor] Lists

2011-06-12 Thread R. Berman
Having followed this absurd thread from its beginning hopefully to this, the end of it. Everyone replying to your diatribe has been incredibly polite to you. One of the moderators tried to explain the obvious to you. This is a Python group. Python is to most of us a delightful language. To other

Re: [Tutor] Saving data as jpg file

2011-06-12 Thread Johan Geldenhuys
Hi, I tried using the "wb" to create and write the file. In a simple test I did to open an existing jpg file I know is good, putting the data in my new file and closing it, it worked. I don't have access to the camera now, but will try it tomorrow. Thanks Johan -Original Message- From

[Tutor] [OT] Re: Floating Point Crazines

2011-06-12 Thread Robert Sjoblom
>> * Or you just get used to the fact that some numbers are not exact in >> floating point. > > This got me thinking. How many decimal places do you need to > accurately, say, aim a laser somewhere in a 180 degree arc accurately > enough to hit a dime on the surface of the moon? > > Alan In short:

[Tutor] subprocess.Popen() OR subprocess.call() ?

2011-06-12 Thread Neha P
Hi all, I am newbie and want to know what is the difference between subprocess.Popen() and subprocess.call() ? when is it best to use each one? Any help appreciated!!  Regards, Neha___ Tutor maillist - Tutor@python.org To unsubscribe or change subsc

[Tutor] Creating Reports in Python

2011-06-12 Thread Mark Cowley - FlexSystems
Hi I am looking for recommendations for Report writers under Python. Current reports are in Crystal reports if that is an option. Any suggestions are welcome. Thanks Mark ___ Tutor maillist - Tutor@python.org To unsubscribe or cha

Re: [Tutor] subprocess.Popen() OR subprocess.call() ?

2011-06-12 Thread Alan Gauld
"Neha P" wrote I am newbie and want to know what is the difference between subprocess.Popen() and subprocess.call() ? Simply speaking, call() is a way to make subprocess easier to use. Popen gives you much more powerful options but that flexibility means it's harder to use. when is it b

Re: [Tutor] [OT] Re: Floating Point Crazines

2011-06-12 Thread Steven D'Aprano
Robert Sjoblom wrote: * Or you just get used to the fact that some numbers are not exact in floating point. This got me thinking. How many decimal places do you need to accurately, say, aim a laser somewhere in a 180 degree arc accurately enough to hit a dime on the surface of the moon? Alan

Re: [Tutor] Creating Reports in Python

2011-06-12 Thread Steven D'Aprano
Mark Cowley - FlexSystems wrote: Hi I am looking for recommendations for Report writers under Python. Current reports are in Crystal reports if that is an option. Any suggestions are welcome. You might get more responses on the main python mailing list, python-l...@python.org, or comp.la

Re: [Tutor] [OT] Re: Floating Point Crazines

2011-06-12 Thread Wayne Werner
On Sun, Jun 12, 2011 at 9:11 PM, Steven D'Aprano wrote: > Robert Sjoblom wrote: > >> * Or you just get used to the fact that some numbers are not exact in floating point. >>> This got me thinking. How many decimal places do you need to >>> accurately, say, aim a laser somewhere in a 180

Re: [Tutor] [OT] Re: Floating Point Crazines

2011-06-12 Thread R. Alan Monroe
> Python's floats have 52 *binary* places of precision, or approximately > 15 *decimal* places. So even though we may not be able to physically > build a machine capable of aiming a laser to a precision of > 0.001 degrees, at least we can be comforted by the knowledge > that a C double o