Re: [Tutor] IDLE Crashing

2006-08-04 Thread Luke Paireepinart
Hi Adam. Adam Gomaa wrote: > I'm having trouble with this script. When I run it, it crashes IDLE... > which is no fun. :( > > I'm running Ubuntu 6.06 w/ python 2.4 > > When I say crash, I mean really _crash_. IDLE stop responding, and I > have to killall idle && killall python2.4 before I can res

[Tutor] IDLE Crashing

2006-08-04 Thread Adam Gomaa
I'm having trouble with this script. When I run it, it crashes IDLE... which is no fun. :( I'm running Ubuntu 6.06 w/ python 2.4 When I say crash, I mean really _crash_. IDLE stop responding, and I have to killall idle && killall python2.4 before I can restart it (cause python2.4 keeps the TCP

Re: [Tutor] how to use

2006-08-04 Thread Kent Johnson
anil maran wrote: > list comprehensions to return a dictionary A list comprehension creates a list. Can you explain why you want this? Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Multiple buttons, One callback (fwd)

2006-08-04 Thread Kent Johnson
Michael Lange wrote: >> -- Forwarded message -- >> Date: Fri, 4 Aug 2006 09:32:48 -0700 (PDT) >> From: Michael Cochez <[EMAIL PROTECTED]> >> To: [EMAIL PROTECTED] >> Subject: Multiple buttons, One callback >> >> Hi Danny, >> I've just been reading your reply on this subject at >> ht

Re: [Tutor] hi

2006-08-04 Thread Kent Johnson
anil maran wrote: > i have a textbox in a webform > i save it in postgres > in postgres, it has several newlines and it is properly displayed > when i redisplay using cheetah > it just displays in a single line and looks ugly > > is there a simple way to replace newlines with s.replace('\n', '')

Re: [Tutor] python unicode - help

2006-08-04 Thread Kent Johnson
anil maran wrote: > postgres takes utf8 > and ie has different encodings, sometimes western, sometimes utf8 > when someone submits data to the form with different, there is an > error, how do we determine the encoding, automatically convert to utf8 > and then feed to postgres Generally a browse

Re: [Tutor] can some one explain

2006-08-04 Thread Kent Johnson
anil maran wrote: > decorators and why uses them makes it faster than if then else blocks > because of decorators using hash structures Do you mean dictionaries rather than decorators? I'm not sure what you are talking about. Kent ___ Tutor maillist

Re: [Tutor] Multiple buttons, One callback (fwd)

2006-08-04 Thread Michael Lange
> -- Forwarded message -- > Date: Fri, 4 Aug 2006 09:32:48 -0700 (PDT) > From: Michael Cochez <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: Multiple buttons, One callback > > Hi Danny, > I've just been reading your reply on this subject at > http://mail.python.org/pipermai

[Tutor] can some one explain

2006-08-04 Thread anil maran
decorators and why uses them makes it faster than if then else blocks because of decorators using hash structuresi dont understand thisplease help me Do you Yahoo!? Next-gen email? Have it all with the all-new Yahoo! Mail Beta.___ Tutor maillist - T

[Tutor] how to use

2006-08-04 Thread anil maran
list comprehensions to return a dictionarythanks a lot See the all-new, redesigned Yahoo.com. Check it out. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] (*args, **kwargs)

2006-08-04 Thread Etienne Robillard
--- Matt Williams <[EMAIL PROTECTED]> wrote: > Dear All, > > I have learnt to do bits of python, but one of the > things I cannot get > my head around is the *args, **kwargs syntax. > I have tried reading stuff on the web, and I have a > copy of the python > cookbook (which uses it as a recipe

[Tutor] Config file directory (was: File like object for Windows registry)

2006-08-04 Thread K . Weinert
Hello again! Thanks a lot for the helpful hints! I was not aware that expanduser does also work on windows since I am on WinMe... My current approach is this: import platform, os.path def _detect_filepath(): op_sys= platform.system() op_rel= platform.release() if op_sys=="Windows":

[Tutor] python unicode - help

2006-08-04 Thread anil maran
postgres takes utf8and ie has different encodings, sometimes western, sometimes utf8when someone submits data to the form with different,  there is an error, how do we determine the encoding, automatically convert to utf8 and then feed to postgresthanks a lot See the all-new, redesigned Yahoo.

[Tutor] hi

2006-08-04 Thread anil maran
i have a textbox in a webformi save it in postgresin postgres, it has several newlines and it is properly displayedwhen i redisplay using cheetahit just displays in a single line and looks uglyis there a simple way to replace newlines with thanks Talk is cheap. Use Yahoo! Messenger to make PC-to

Re: [Tutor] (*args, **kwargs)

2006-08-04 Thread Matt Williams
Dear Etienne & Carlos, Thanks so much for that - much clearer! I guess the next question is _how_ do you use it intelligently? I'm interested because I'm trying to put stuff into a db using sqlobject. Obviously one way would be: class MyClass: def __init__(self,**kw) self.proper

[Tutor] Multiple buttons, One callback (fwd)

2006-08-04 Thread Danny Yoo
Hi everyone, Can someone help with Michael's question? Unfortunately, I can't answer it at the moment. Here it is below. (I've stripped off the image attachment.) -- Forwarded message -- Date: Fri, 4 Aug 2006 09:32:48 -0700 (PDT) From: Michael Cochez <[EMAIL PROTECTED]> To: [

Re: [Tutor] (*args, **kwargs)

2006-08-04 Thread Jordan Greenberg
Matt Williams wrote: > Dear All, > > I have learnt to do bits of python, but one of the things I cannot get > my head around is the *args, **kwargs syntax. > > I have tried reading stuff on the web, and I have a copy of the python > cookbook (which uses it as a recipe early on) but I still don'

Re: [Tutor] Listbox selection

2006-08-04 Thread Luke Paireepinart
Michael Lange wrote: > Hi Joe, > [snip post] Fix your date/time please Michael. I don't think it's been February 10th for quite some time :) ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] (*args, **kwargs)

2006-08-04 Thread Matt Williams
Dear All, I have learnt to do bits of python, but one of the things I cannot get my head around is the *args, **kwargs syntax. I have tried reading stuff on the web, and I have a copy of the python cookbook (which uses it as a recipe early on) but I still don't understand it. Please could som

Re: [Tutor] Listbox selection

2006-08-04 Thread Michael Lange
Hi Joe, On Thu, 3 Aug 2006 11:12:28 -0700 "Joe Cox" <[EMAIL PROTECTED]> wrote: > I am still having a problem getting my listbox's binded to the radiobuttons. > I am getting closer. > > ###Assign each Radiobutton with its own listbox values, show one selected > button and one listbox### > > >

Re: [Tutor] Binary fractions, recommendations?

2006-08-04 Thread Kent Johnson
Alan Gauld wrote: > Does anyone know how I could work on a binary >> representation of a float? Any language at all, >> >>> In C you can certainly get access to the binary representation of a >>> float as bytes. My C is really rusty but something like >>> float x = 1.3; >>> char* p = &x; >>>

Re: [Tutor] critique my script again!

2006-08-04 Thread Kent Johnson
Christopher Spears wrote: > import os, os.path, glob > > def create_dict(path, globbed_dict): > os.chdir(path) > matched_files = glob.glob(pattern) > if matched_files != []: > globbed_dict[path] = matched_files > return globbed_dict > As written create_dict(

Re: [Tutor] Binary fractions, recommendations?

2006-08-04 Thread Alan Gauld
> Always found it quite strange that working mathematically with > binary > is so hard in programming languages. Even in Scheme, which will > happily play with imaginary numbers. I'm not clear on what you want to do. You are working mathematically with binary all the time, in fact that's the reas