Re: [Tutor] ASCII Conversion

2012-01-30 Thread Peter Otten
Peter Otten wrote: > if isint and y < -1 or y > 1: Sorry, I forgot the parentheses. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] ASCII Conversion

2012-01-30 Thread Peter Otten
Michael Lewis wrote: > I am trying to do a simple test but am not sure how to get around ASCII > conversion of characters. I want to pass in y have the function test to > see if y is an integer and print out a value if that integer satisfies the > if statement. However, if I pass in a string, it's

Re: [Tutor] ASCII Conversion

2012-01-30 Thread Blockheads Oi Oi
On 31/01/2012 05:33, Christian Witts wrote: On 2012/01/31 06:50 AM, Michael Lewis wrote: I am trying to do a simple test but am not sure how to get around ASCII conversion of characters. I want to pass in y have the function test to see if y is an integer and print out a value if that integer sa

Re: [Tutor] ASCII Conversion

2012-01-30 Thread Christian Witts
On 2012/01/31 06:50 AM, Michael Lewis wrote: I am trying to do a simple test but am not sure how to get around ASCII conversion of characters. I want to pass in y have the function test to see if y is an integer and print out a value if that integer satisfies the if statement. However, if I pas

Re: [Tutor] ASCII Conversion

2012-01-30 Thread David Kidd
On Tue, Jan 31, 2012 at 15:50, Michael Lewis wrote: > ... However, if I pass in a string, it's converted to ASCII and will > still satisfy the if statement and print out value. How do I ensure that a > string is caught as a ValueError instead of being converted? It depends on what you want to do

[Tutor] ASCII Conversion

2012-01-30 Thread Michael Lewis
I am trying to do a simple test but am not sure how to get around ASCII conversion of characters. I want to pass in y have the function test to see if y is an integer and print out a value if that integer satisfies the if statement. However, if I pass in a string, it's converted to ASCII and will s

Re: [Tutor] New user Knows nothing about python I Need HELP

2012-01-30 Thread Joel Goldstick
On Mon, Jan 30, 2012 at 5:41 PM, William Stewart wrote: > thanks I havent learned anything about prgramming its a computer sicence > class, I will try the links > thanks again > > --- On *Mon, 1/30/12, Joel Goldstick * wrote: > > > From: Joel Goldstick > Subject: Re: [Tutor] New user Knows noth

Re: [Tutor] New user Knows nothing about python I Need HELP

2012-01-30 Thread Joel Goldstick
On Mon, Jan 30, 2012 at 2:21 PM, Jerry Hill wrote: > On Mon, Jan 30, 2012 at 2:02 PM, William Stewart > wrote: >> I have no Idea how to start this task I have never used ANY programming >> programs before And I dont Know the language either >> The online help files from python Did not help a bit

Re: [Tutor] New user Knows nothing about python I Need HELP

2012-01-30 Thread Jerry Hill
On Mon, Jan 30, 2012 at 2:02 PM, William Stewart wrote: > I have no Idea how to start this task I have never used ANY programming > programs before And I dont Know the language either > The online help files from python Did not help a bit Here's a few resources that might get you started. Firs

[Tutor] New user Knows nothing about python I Need HELP

2012-01-30 Thread William Stewart
hello I am trying to make a math functions program which includes ADDITION: 2+2=4 SUBTRACTION: 4-2=2 MULTIPLICATION: 4*2=8 DIVISION: 4/2=2 EXPONENT: 2**3=8 REMAINDER: 5%2=1 I have no Idea how to start this task I have never used ANY programming programs before And I dont Know the language eit

Re: [Tutor] Sort

2012-01-30 Thread Steven D'Aprano
George Nyoro wrote: Hey all, again: Thanks for the delete thing. Helped with that problem a lot. Especially the getattr thing came in handy. Question 1: How do you guys indent and put in the triple greater than signs and all that when sending mail? Manually? Coz the last mail I sent was using th

Re: [Tutor] Tutor Digest, Vol 95, Issue 80

2012-01-30 Thread Arun Kumar
de = LEFT, padx = 10, pady = 10) > .(Some more lines) > C.mainloop() > > > Because I am getting stuck in a loop. The client is keep on connecting > to server without creating a GUI. > > > > > > > > > > > > > > ---

[Tutor] Sort

2012-01-30 Thread George Nyoro
Hey all, again: Thanks for the delete thing. Helped with that problem a lot. Especially the getattr thing came in handy. Question 1: How do you guys indent and put in the triple greater than signs and all that when sending mail? Manually? Coz the last mail I sent was using the gmail indent thing a

Re: [Tutor] loop until a keypress

2012-01-30 Thread Steven D'Aprano
Surya K wrote: I am on windows. So, as msvcrt is for windows, I wonder if there is any module that works for both, http://code.activestate.com/recipes/577977 -- Steven ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription opt

Re: [Tutor] loop until a keypress

2012-01-30 Thread Christian Witts
On 2012/01/30 07:20 AM, Surya K wrote: I want to run code until a "enter" is pressed. Well, it shouldn't wait for the user to enter "enter" This is my code: import msvcrt chr = 0 while chr != 'q': print "my code", if msvcrt.kbhit(): chr = msvcrt.getch() This isn't workin

Re: [Tutor] loop until a keypress

2012-01-30 Thread Alan Gauld
On 30/01/12 05:20, Surya K wrote: I want to run code until a "enter" is pressed. Well, it shouldn't wait for the user to enter "enter" This is my code: import msvcrt chr = 0 while chr != 'q': print "my code", if msvcrt.kbhit(): chr = msvcrt.getch() You shouldn't need the kbhit test. Try jus

Re: [Tutor] loop until a keypress

2012-01-30 Thread Peter Otten
Surya K wrote: > I want to run code until a "enter" is pressed. Well, it shouldn't wait for > the user to enter "enter" This is my code: This is what it looks like over here: > import msvcrtchr = 0while chr != 'q': print "my code", if > msvcrt.kbhit(): chr = msvcrt.getch() Th