[Tutor] HELP: wxPython, adding items to combo box?

2005-07-04 Thread Aaron Elbaz
The simplest way I can explain this: I have a settings wxPython settings dialog, which contains a 'servers' combo box. I also have a shelf object that 'remembers' values entered into the ComboBox. The current value is stored as shelf['SERVER'] and the old values are kept in a list at shelf['OLD_SER

Re: [Tutor] What's wrong with this code?

2005-07-04 Thread Andre Engels
>From the program:: answer = raw_input("What is the password? ") while password != answer: print "The password is incorrect." If the user submits a wrong password, the while-loop will be entered. The program prints "The password is incorrect." then tests whether the password is still not equa

Re: [Tutor] What's wrong with this code?

2005-07-04 Thread Liam Clarke
Also - menu_choice = input("Choose an option: ") input() is always bad. Use int(raw_input(""Choose an option: ")) instead. input() evaluates your input as a Python _expression_ - I could select 9 by entering 5+4 or, I could enter sys.exit() and drop to DOS (or whatever it's running on.) or f

Re: [Tutor] What's wrong with this code?

2005-07-04 Thread Liam Clarke
What error messages are you getting? Please post the full message.On 7/5/05, Nathan Pinno <[EMAIL PROTECTED] > wrote: What's wrong with this code? I'm using 2.2.3 if this helps.   #This is for a password protected program to store passwords. password = "hello"print "The Password Prog

Re: [Tutor] I sure do love cookies.

2005-07-04 Thread Liam Clarke
Hi, Denise, if you're handling cookies client side, then this is how to do it (code snippets taken from http://www.voidspace.org.uk/python/articles/cookielib.shtml as I'm at work.) import os.path import urllib2 import cookielib COOKIEFILE = 'cookies.lwp' # the path and filename to save your c

[Tutor] What's wrong with this code?

2005-07-04 Thread Nathan Pinno
What's wrong with this code? I'm using 2.2.3 if this helps.   #This is for a password protected program to store passwords. password = "hello"print "The Password Program"print "Copywrite 2005. All Rights Reserved."printanswer = raw_input("What is the password? ")while password !=

Re: [Tutor] Is there a way to combine a request for numbers and letters?

2005-07-04 Thread Nathan Pinno
Sorry,   Just remembered that strings can include both letters and numbers. Case closed.   Nathan PinnoCrew, McDonalds Restaurant, Camrose, AB Canadahttp://www.npinnowebsite.ca/ - Original Message - From: Nathan Pinno To: tutor@python.org Sen

[Tutor] Is there a way to combine a request for numbers and letters?

2005-07-04 Thread Nathan Pinno
Hi all,   Is there a way to combine a request for numbers and letters (e.g. user id and passwords)?   Thanks, Nathan Pinnohttp://www.npinnowebsite.ca/ ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] update (fwd)

2005-07-04 Thread Danny Yoo
-- Forwarded message -- Date: Mon, 04 Jul 2005 12:55:45 -0700 From: nephish <[EMAIL PROTECTED]> To: Danny Yoo <[EMAIL PROTECTED]> Subject: update Hey, i did what you said, added print lines to debug my line_finder function, and it was finding everythin ok, just iterating through

Re: [Tutor] How do I make Python calculate square roots?

2005-07-04 Thread Pierre Barbier de Reuille
Or, you can use: complex(-1)**0.5 However the result is strange ... >>> complex(-1)**0.5 (6.1230317691118863e-17+1j) Pierre Danny Yoo a écrit : > > On Sat, 2 Jul 2005, Reed L. O'Brien wrote: > > >>>Does anyone know how to make Python calculate square roots? >>> >> >>Raise to the 1/2 pow

Re: [Tutor] I sure do love cookies.

2005-07-04 Thread Kent Johnson
Danny Yoo wrote: > To make cookies, in the examples of the Cookie module will probably help > the most: > > http://www.python.org/doc/lib/cookie-example.html > >>From the documentation, it sounds like Cookie.SimpleCookie is what you're > looking for: My understanding is that the Cookie modul

Re: [Tutor] search through a list

2005-07-04 Thread nephish
Danny Yoo wrote: > > >>#this function returns the number of lines on record for each log file. >>def line_finder(LogsInDir, flag): >>flag=flag.strip() >>return_next=False >>for line in LogsInDir: >>if return_next: >>return line.strip() >>else: >>if lin

Re: [Tutor] I sure do love cookies.

2005-07-04 Thread Danny Yoo
On Fri, 1 Jul 2005, D. Hartley wrote: > Anyone have a good (*simple*) tutorial on making/sending cookies via > python? (i.e., not receiving/messing with them). Hi Denise, I did find one tutorial here that might help with the receiving side of things: http://www.voidspace.org.uk/python/art

Re: [Tutor] Confused about error message

2005-07-04 Thread Danny Yoo
On Sun, 3 Jul 2005, gelsey torres wrote: > I'm new to Python and computer programming in general. Eventually I got > sick of just reading my programming books and typing code from them into > the interpreter, so I decided to write a script that will grab files > from websites and save them to th

Re: [Tutor] Confused about error message

2005-07-04 Thread Ewald Ertl
Hi! you're missing the except-clause in the exception-handling: on Sun, 3 Jul 2005 21:37:57 -0400 gelsey torres <[EMAIL PROTECTED]> wrote : - gelsey torres > I'm new to Python and computer programming

Re: [Tutor] search through a list

2005-07-04 Thread Danny Yoo
> #this function returns the number of lines on record for each log file. > def line_finder(LogsInDir, flag): > flag=flag.strip() > return_next=False > for line in LogsInDir: > if return_next: > return line.strip() > else: > if line.strip() == flag: >