[Tutor] How do I get user input when running a python program?

2012-03-15 Thread Tamar Osher

Hi.  I am reading Python for the Absolute Beginner, finished chapter 4, and am 
trying to duplicate the author's games.  In order to know if I have properly 
created my new games, I need to get user input and see what happens.  How do I 
set things up on my computer so that I can get user input when my new program 
is being run?  I have Python 3.2.2 and a Windows7 64-bit computer.  I hope to 
hear from someone; thank you very much for helping me.  I am very appreciative!




  ___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How do I get user input when running a python program?

2012-03-15 Thread Prasad, Ramit
Hi.  I am reading Python for the Absolute Beginner, finished chapter 4, and am 
trying to duplicate the author's games.  In order to know if I have properly 
created my new games, I need to get user input and see what happens.  How do I 
set things up on my computer so that I can get user input when my new program 
is being run?  I have Python 3.2.2 and a Windows7 64-bit computer.  I hope to 
hear from someone; thank you very much for helping me.  I am very appreciative!

How is the author doing it? What code do you have? What problems are you facing?
What errors are you getting (please copy/paste the full error message including 
stack trace)? 


Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423

--


This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How do I get user input when running a python program?

2012-03-15 Thread Walter Prins
Hi Tamar,

On 15 March 2012 17:59, Tamar Osher emeraldoff...@hotmail.com wrote:
 Hi.  I am reading Python for the Absolute Beginner, finished chapter 4, and
 am trying to duplicate the author's games.  In order to know if I have
 properly created my new games, I need to get user input and see what
 happens.  How do I set things up on my computer so that I can get user input
 when my new program is being run?  I have Python 3.2.2 and a Windows7 64-bit
 computer.  I hope to hear from someone; thank you very much for helping me.
  I am very appreciative!

Firstly, what version of the book are you using?  (Or more
specifically, what version of Python is the book using?)  You're just
setting yourself up for trouble if your book is using a substantially
different version of Python than you are.  (The first version of the
book, for example, came out in 2003 and uses Python 2.2...)  The
second edition came out around 2006 so probably also uses Python 2.x
so even if you're using that, I'd suggest you perhaps consider
uninstalling Python 3 and (for now at least) installing something
closer to what the book is using. (Sorry if this causes you trouble,
but IMHO it's probably better for you to not introduce more
unnecessary variables that make your learning more complicated that it
needs to be and using Python 3.x when your book is 2.x will make
things more complicated than it needs to be.)

Secondly, have you actually read the first 3 chapters?  I ask, because
by your question it appears you may not have, or may not have properly
absorbed the content.  For example, in the first chapter of the book
(at the least, the first version), your question is partially
answered.  I quote:

*Waiting for the user*


The last line of the program:

raw_input(\n\nPress the Enter key to exit.)

displays the prompt Press the Enter key to exit. and waits for the
user to press the Enter key.  Once the user presses the key, the
program ends. This is a nice trick to keep a console window open until
the user is done with an application.

Similarly, there's a section entitled Getting user input in chapter
2.  So, to echo Ramit, are you having trouble understanding how the
author does it in Chapter 1  2?  If not, what are you stuck on?

Regards,

Walter
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor