Re: [Tutor] Learning books

2005-12-23 Thread w chun
On 12/20/05, Richard <[EMAIL PROTECTED]> wrote: > Afternoon all, My son asked me what books I would like for Christmas > this year. So what would you recommend? > > I am a beginner here. hi richard, welcome to the list. are you a beginner to Python (but have programming experience), a beginner

[Tutor] assert

2005-12-23 Thread shivayogi kumbar
sir, I would like to know about 'asser't keyword how it works in the fallowing program class myClass: count = 0 def __init__(self): myClass.count = myClass.count + 1 def __del_

Re: [Tutor] assert

2005-12-23 Thread python-tutor
Try this: >>>a=myClass() >>>b=myClass() >>>a.howmany() >>>a.count=0 >>>del a Does this help clear things up? Todd Maynard On Friday 23 December 2005 06:18, shivayogi kumbar wrote: > class myClass: >                         count = 0 >                          def __init__(self): >            

Re: [Tutor] assert

2005-12-23 Thread Kent Johnson
shivayogi kumbar wrote: > sir, >I would like to know about 'asser't keyword how it works in the > fallowing program I'm not sure what the question is. Do you not understand assert at all or is there something about how this program works that you don't understand? assert is documented here:

[Tutor] Input checking [letters or numbers]

2005-12-23 Thread Panagiotis Atmatzidis
Hello, Can someone provide me with an error checking example about an x variable that needs to be number only? I used something like: def useridf(): print "" print "WARNING: If you don't understand why this must be unique, exit and read the manual." print "" userid = input("x

Re: [Tutor] Input checking [letters or numbers]

2005-12-23 Thread bob
At 10:15 AM 12/23/2005, Panagiotis Atmatzidis wrote: >Hello, > >Can someone provide me with an error checking example about an x >variable that needs to be number only? I used something like: > > def useridf(): > print "" > print "WARNING: If you don't understand why this must be unique,

Re: [Tutor] assert

2005-12-23 Thread python-tutor
Shivayogi, Sorry my last e-mail wasn't very helpful. Better would have been: >>> a=myClass() >>> b=myClass() >>> a.howmany() >>> myClass.count=0 >>> del a which will (hopefully) give you something like: Exception exceptions.AssertionError: in > ignored Assert is commonly used as a sanity

Re: [Tutor] Input checking [letters or numbers]

2005-12-23 Thread Panagiotis Atmatzidis
Hello there, Thank you for the prompt response. On 12/23/05, bob <[EMAIL PROTECTED]> wrote: > At 10:15 AM 12/23/2005, Panagiotis Atmatzidis wrote: > >Hello, > > > >Can someone provide me with an error checking example about an x > >variable that needs to be number only? I used something like: > >

Re: [Tutor] Input checking [letters or numbers]

2005-12-23 Thread Danny Yoo
> x = raw_input("x : ") > if x.isdigit(): # ensure input is a number >y = int(x) # convert to integer > else: >print 'Boo" Hello Bob and Panagiotis, It might be good to make this number-reading thing a function, just to make it easier to reuse (and test!) it. Let's call this input_numbe

Re: [Tutor] Input checking [letters or numbers]

2005-12-23 Thread Panagiotis Atmatzidis
Hello Dany :-) On 12/23/05, Danny Yoo <[EMAIL PROTECTED]> wrote: > > x = raw_input("x : ") > > if x.isdigit(): # ensure input is a number > >y = int(x) # convert to integer > > else: > >print 'Boo" > > > Hello Bob and Panagiotis, > > It might be good to make this number-reading thing a fun

Re: [Tutor] Input checking [letters or numbers]

2005-12-23 Thread Panagiotis Atmatzidis
Yeah works you're right. :-) On 12/23/05, bob <[EMAIL PROTECTED]> wrote: > At 11:16 AM 12/23/2005, Panagiotis Atmatzidis wrote: > >Hello there, > > > >Thank you for the prompt response. > > > >On 12/23/05, bob <[EMAIL PROTECTED]> wrote: > >[snip] > > > print input("x ; ") > > > and enter "Hello wo

Re: [Tutor] Input checking [letters or numbers]

2005-12-23 Thread bob
At 11:16 AM 12/23/2005, Panagiotis Atmatzidis wrote: >Hello there, > >Thank you for the prompt response. > >On 12/23/05, bob <[EMAIL PROTECTED]> wrote: >[snip] > > print input("x ; ") > > and enter "Hello world" > > >>> x = input("x: ") >x: hello world >Traceback (most recent call last): > File "

Re: [Tutor] Input checking [letters or numbers]

2005-12-23 Thread Panagiotis Atmatzidis
On 12/23/05, Panagiotis Atmatzidis <[EMAIL PROTECTED]> wrote: > Hello Dany :-) > > On 12/23/05, Danny Yoo <[EMAIL PROTECTED]> wrote: [...] > > > > > > Hello Bob and Panagiotis, > > > > It might be good to make this number-reading thing a function, just to > > make it easier to reuse (and test!) it.

Re: [Tutor] Input checking [letters or numbers]

2005-12-23 Thread Kent Johnson
Panagiotis Atmatzidis wrote: > Hello, > > Can someone provide me with an error checking example about an x > variable that needs to be number only? I used something like: > > def useridf(): > print "" > print "WARNING: If you don't understand why this must be unique, > exit and read th

Re: [Tutor] Learning books

2005-12-23 Thread Richard
First of thanks for all the great input from everyone!!! Okay, so I have been reading some of the tutorials around the net on Python. great stuff I might add but I am getting all confused with the TCL, xwwidgets etc. I want to be able to program and I am just using the standard IDE that comes w

Re: [Tutor] Input checking [letters or numbers]

2005-12-23 Thread bob
At 11:28 AM 12/23/2005, Panagiotis Atmatzidis wrote: >On 12/23/05, Panagiotis Atmatzidis <[EMAIL PROTECTED]> wrote: > > Hello Dany :-) > > > > On 12/23/05, Danny Yoo <[EMAIL PROTECTED]> wrote: >[...] > > > > > > > > > Hello Bob and Panagiotis, > > > > > > It might be good to make this number-readin

Re: [Tutor] Learning books

2005-12-23 Thread Nick Lunt
Hi Richard, I myself just about know enough python to help me in my job occasionally and to do some cool little hobby projects. When it comes to creating GUI's for my programs I always use pythoncard, see here www.pythoncard.org . It's very simple to use, and the tutorials on their site will have