Re: [Tutor] Binary Real to Decimal

2009-03-30 Thread spir
Le Sun, 29 Mar 2009 22:42:43 -0500, Chris Castillo s'exprima ainsi: > myinput = raw_input("Please enter a binary real number: ") > myinput = myinput.split(".") > > binstr1 = myinput[0] > binstr2 = myinput[1] > > decnum1 = 0 > decnum2 = 0 > > for i in binstr1: > decnum1 = decnum1 * 2 + int

[Tutor] Shelve doesn't free up memory

2009-03-30 Thread Timo
Hello, I have a PyGTK application where the user is able to click on a button, then a new dialog pops up with a treeview and the program fills this view with data from a shelve. Everything works, the data is being added to the treeview. The only problem is, that when I close the dialog, it doesn

[Tutor] how are unicode chars represented?

2009-03-30 Thread spir
Everything is in the title ;-) (Is it kind of integers representing the code point?) Denis -- la vita e estrany ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] __callattr__ ?

2009-03-30 Thread spir
Hello, Is there something like a __callattr__ magic method that would catch either unknown (like __getattr__) or all (like __getattribute__) method calls? If not, how would you do that? Also if not, do you know why we have __getattr__, __setattr__, but no __callattr__? Denis -- la vita e es

Re: [Tutor] how are unicode chars represented?

2009-03-30 Thread Kent Johnson
On Mon, Mar 30, 2009 at 3:36 AM, spir wrote: > Everything is in the title ;-) > (Is it kind of integers representing the code point?) Unicode is represented as 16-bit integers. I'm not sure, but I don't think Python has support for surrogate pairs, i.e. characters outside the BMP. Kent _

Re: [Tutor] Left Alignment -- Tkinter

2009-03-30 Thread Wayne Watson
Title: Signature.html I'm tossing in the towel on this one. I have an acceptable way to put in a few lines like: Latitude BOX   Longitude BOX Instead of prototyping it separately from the main program, I just went directly to the author's code, and put the lines in the common style he used. It

Re: [Tutor] __callattr__ ?

2009-03-30 Thread Kent Johnson
On Mon, Mar 30, 2009 at 5:51 AM, spir wrote: > Hello, > > Is there something like a __callattr__ magic method that would catch either > unknown (like __getattr__) or all (like __getattribute__) method calls? > If not, how would you do that? Also if not, do you know why we have > __getattr__, __s

[Tutor] installation of scipy

2009-03-30 Thread Bala subramanian
Friends i installed scipy in fedora10 using yum. when i import stats module in it, i got the following warning. someone pls englihten me on this. >>> from scipy import stats /usr/lib/python2.5/site-packages/scipy/sparse/linalg/dsolve/linsolve.py:20: DeprecationWarning: scipy.sparse.linalg.dsolve.u

Re: [Tutor] Binary Real to Decimal

2009-03-30 Thread Dave Angel
I don't know what "sufficient numbers" means, but perhaps it's "significant digits" that was intended. And you have to decide if you want ten digits to the right of the decimal point, or ten significant digits in the whole number. That determines whether you want to round decnum2 or the final

Re: [Tutor] installation of scipy

2009-03-30 Thread Arun Tomar
hi! Bala. On Mon, Mar 30, 2009 at 3:57 PM, Bala subramanian wrote: > Friends > i installed scipy in fedora10 using yum. when i import stats module in it, i > got the following warning. someone pls englihten me on this. > from scipy import stats > /usr/lib/python2.5/site-packages/scipy/sparse

Re: [Tutor] Shelve doesn't free up memory

2009-03-30 Thread Emile van Sebille
Timo wrote: # Results file import shelve def read_result(person): results = [] s = shelve.open(RESULTFILE) try: results = s[person] Maybe passing this out prevents s from being garbage collected? Emile except KeyError: #print "No results for this person"

Re: [Tutor] Left Alignment -- Tkinter

2009-03-30 Thread W W
On Sun, Mar 29, 2009 at 9:30 AM, Wayne Watson wrote: > I'm looking at the NM Tech Tkinter ref, pages 5-6, on the grid > method. See pages 84-88 of Lundh. Nothing. It does not show that method. > Search of the pdf doc shows nothing. Are these sources too old? effbot does > have it. Yes, it's pretty

[Tutor] incrementing one minute

2009-03-30 Thread pa yo
I need to add one minute to a string that has a date and a time in MMDDHHMM format. e.g: 200903281346 should become 200903281347 the following script converts the string into time and adds one minute; but somehow I also add an hour and I don't understand why. import tim

Re: [Tutor] incrementing one minute

2009-03-30 Thread pa yo
I fixed it by re-setting my system clock to GMT. ... it seems a bit of a botch but it works. Payo On Mon, Mar 30, 2009 at 4:52 PM, pa yo wrote: > I need to add one minute to a string that has a date and a time in > MMDDHHMM format. > e.g:  200903281346 should become 200903281347 > > the f

Re: [Tutor] incrementing one minute

2009-03-30 Thread Richard Lovely
2009/3/30 pa yo : > I need to add one minute to a string that has a date and a time in > MMDDHHMM format. > e.g:  200903281346 should become 200903281347 > > the following script converts the string into time and adds one > minute; but somehow I also add an hour and I don't understand why. > >

Re: [Tutor] incrementing one minute

2009-03-30 Thread Sander Sweers
2009/3/30 pa yo : > I need to add one minute to a string that has a date and a time in > MMDDHHMM format. > e.g:  200903281346 should become 200903281347 > > the following script converts the string into time and adds one > minute; but somehow I also add an hour and I don't understand why. > >

Re: [Tutor] installation of scipy

2009-03-30 Thread Trilok Khairnar
More specifically, in this case, numpy.stats should be used instead of scipy.stats You will not see the deprecation warning with numpy.stats On Mon, Mar 30, 2009 at 5:15 PM, Arun Tomar wrote: > hi! > Bala. > > On Mon, Mar 30, 2009 at 3:57 PM, Bala subramanian > wrote: > > Friends > > i install

Re: [Tutor] incrementing one minute

2009-03-30 Thread Dave Angel
mktime() and gmtime() are not inverses of each other. The first assumes local time, and the latter gmt (or utc). So unless you happen to be in England, and not in daylight savings time, you'd expect a problem. mktime() is documented as the inverse of localtime(), according to the docs. I'd

Re: [Tutor] incrementing one minute

2009-03-30 Thread Dave Angel
This is the second post I've seen on this homework assignment. You might look at the Python List for other ideas. mktime() and gmtime() are not inverses of each other. The first assumes local time, and the latter gmt (or utc). So unless you happen to be in England, and not in daylight savin

Re: [Tutor] incrementing one minute

2009-03-30 Thread pa yo
I am trying to filter Open Street Map nodes from http://planet.openstreetmap.org/minute/ ... into wikimark up for Yellowikis (http://www.yellowikis.org) I work from home - but this isn't a homework assignment. :-) Paul Y On Mon, Mar 30, 2009 at 5:52 PM, Dave Angel wrote: > This is the second

[Tutor] range() fractional increment

2009-03-30 Thread james carnell
1) I feel dumb for asking this. 2) I looked for 20 minutes and didn't find an answer Trying to make a drawLine function in a 2d array. example: x   row = 25 : col = 10 x   row = 26 : col = 10.3 x   row = 27 : col = 10.6 0x000   row = 28 : col = 11 0x000   row = 29 : col = 11.3 0x000  

Re: [Tutor] range() fractional increment

2009-03-30 Thread John Fouhy
2009/3/31 james carnell : > for row in range(25,31,1): >     for col in range(10,12, 0.3):  #<- Crash Bang doesn't work 0.3 = zero = > infinite loop? > [...] > is there no way to do it with a range function (and have it still look like > you're not on crack)? Well, you could do this: >>> [float(x

Re: [Tutor] range() fractional increment

2009-03-30 Thread Lie Ryan
John Fouhy wrote: 2009/3/31 james carnell : for row in range(25,31,1): for col in range(10,12, 0.3): #<- Crash Bang doesn't work 0.3 = zero = infinite loop? [...] is there no way to do it with a range function (and have it still look like you're not on crack)? Well, you could do this: [

Re: [Tutor] how are unicode chars represented?

2009-03-30 Thread Mark Tolonen
"Kent Johnson" wrote in message news:1c2a2c590903300352t2bd3f1a7j5f37703cf1c3...@mail.gmail.com... On Mon, Mar 30, 2009 at 3:36 AM, spir wrote: Everything is in the title ;-) (Is it kind of integers representing the code point?) Unicode is represented as 16-bit integers. I'm not sure, but