Re: [Tutor] paper scissors

2011-09-23 Thread R. Alan Monroe
>> There are 2 things I don't understand. >> 1. the %s >> 2. the (wins,loses) Did you ever play Mad Libs when you were a kid? http://en.wikipedia.org/wiki/Madlibs Same concept. The %s in Python is just like the blank spaces in a Mad Lib game. The items in parentheses after a percent sign are th

Re: [Tutor] integrating python and C

2011-09-23 Thread Chris Fuller
Sudoku is actually a pretty easy problem computationally, I'd do the whole thing in Python, unless you aren't as comfortable doing fancy algorithms (usually easier, anyway, unless you aren't used to the language, or really need static typing) in Python.. but then this would be a good opportunit

[Tutor] integrating python and C

2011-09-23 Thread surya k
Hi! Actually, I'm writing sudoku solver. So, I'd write my logic in C but when it comes to GUI, I feel that python is much easier than doing in C. What I'm looking at is, take input from python program with graphic interface and passing it to my C program file then solve the puzzle and again passin

Re: [Tutor] How it is better than java

2011-09-23 Thread Steven D'Aprano
Alan Gauld wrote: Apart from trolling the list what do you hope to gain from this post? Be fair -- there's no evidence that Ashish Gaonker was insincere about his question or trying to stir up trouble. It is a very common misapprehension that "language Foo is faster than language Bar", and

Re: [Tutor] password loop

2011-09-23 Thread Steven D'Aprano
ADRIAN KELLY wrote: Can anyone help me with the programme below; i hope you can see what i am trying to do, if i enter the wrong password the loop goes on forever and if i enter the right one nothing is printed... i am a newbieall comments welcome thanks adrian p

Re: [Tutor] password loop

2011-09-23 Thread Steve Willoughby
On 23-Sep-11 15:56, ADRIAN KELLY wrote: Can anyone help me with the programme below; i hope you can see what i am trying to do, if i enter the wrong password the loop goes on forever and if i enter the right one nothing is printed... i am a newbieall comments welcome Remember that r

Re: [Tutor] password loop

2011-09-23 Thread eire1130
The while condition is never true when you enter the correct password. So the while loop is evaluated False and is never triggered. What you should do, as a general rule of troubleshooting, is to use print statements. So print the two outcomes and print the boolean evaluation I'm assuming wh

[Tutor] password loop

2011-09-23 Thread ADRIAN KELLY
Can anyone help me with the programme below; i hope you can see what i am trying to do, if i enter the wrong password the loop goes on forever and if i enter the right one nothing is printed... i am a newbieall comments welcome thanks adrian print 'hello' print 'i

Re: [Tutor] How it is better than java

2011-09-23 Thread Alan Gauld
On 19/09/11 14:27, Ashish Gaonker wrote: First, to address the question in your subject line, we need to agree a definition of "better". In what respect? And by which benchmark? And who claimed that either one was "better" anyway? No serious programmer would be likely to make such a vague compa

Re: [Tutor] guess-my-number programme

2011-09-23 Thread Wayne Werner
On Fri, Sep 23, 2011 at 2:25 PM, ADRIAN KELLY wrote: > > can anyone explain the *tries* part of this programme to me i know its meant > to count the number of guesses made by the user by adding 1 but i just cant > figure out how it does this..can someone explain?? i.e. tries = 1, > tries

Re: [Tutor] guess-my-number programme

2011-09-23 Thread Emile van Sebille
On 9/23/2011 12:25 PM ADRIAN KELLY said... can anyone explain the *tries * part of this programme to me i know its meant to count the number of guesses made by the user by adding 1 but i just cant figure out how it does this..can someone explain?? i.e. tries = 1, tries +1 etc cant g

[Tutor] guess-my-number programme

2011-09-23 Thread ADRIAN KELLY
import random print("\tWelcome to 'Guess My Number'!") print("I'm thinking of a number between 1 and 100.") print("Try to guess it in as few attempts as possible.\n") # set the initial values the_number = random.randint(1, 100) guess = int(input("Take a guess: ")) tries = 1 # guessing loop while

Re: [Tutor] paper scissors

2011-09-23 Thread bob gailer
On 9/23/2011 2:04 PM, Joseph Shakespeare wrote: Wow, thanks so much! This is amazing! One question though. I understand everything in the program except these 2 lines: Wins: %s Loses:%s""" % (wins,loses) There are 2 things I don't understand. 1. the %s 2. the (wins,loses) Any explanation you

Re: [Tutor] Need a bump in the right direction (network programming)

2011-09-23 Thread Mac Ryan
On Fri, 23 Sep 2011 17:03:29 +0800 Cheeyung wrote: > >> On 09/23/2011 01:15 AM, Cheeyung wrote: > >>> I'm creating a mobile application and I'm using python for a > >>> desktop server. However, I don't have access to a static IP on the > >>> desktop, but do have a website. Is it possible to conne

Re: [Tutor] Need a bump in the right direction (network programming)

2011-09-23 Thread Mac Ryan
On Fri, 23 Sep 2011 03:20:53 -0400 Dave Angel wrote: > On 09/23/2011 01:15 AM, Cheeyung wrote: > > I'm creating a mobile application and I'm using python for a > > desktop server. However, I don't have access to a static IP on the > > desktop, but do have a website. Is it possible to connect from

Re: [Tutor] Need a bump in the right direction (network programming)

2011-09-23 Thread Dave Angel
On 09/23/2011 01:15 AM, Cheeyung wrote: I'm creating a mobile application and I'm using python for a desktop server. However, I don't have access to a static IP on the desktop, but do have a website. Is it possible to connect from mobile -> http website -> desktop server and back? What kind o