[Tutor] noob question (Windows, Python 3.1)

Michael Connors connorsml at gmail.com
Thu Aug 6 09:52:10 CEST 2009


2009/8/6 Joshua Harper <joshharper27 at gmail.com>

> Ok, so I am trying to learn python, and I am reading many tutorial type
> things and I am kind of stuck with implementing some of the code... so for
> example the tutorial says "*To get the examples working properly, write
> the programs in a text file and then run that with the interpreter*"
> Alright...simple enough so I wirte the example program:
>
> x = input("Please enter a number: ")
> print "The square of that number is
>
> I save this as a .py and Open With>python.exe. OK, so that gives me the
> terminal ansking me to enter a number, I enter a number and click enter and
> then it prints in like half a nanosecond and the cmd line window closes. I
> want to know how to have the window stay open so that, in future scripts I
> may be able to actually see what was printed. I talked to my friend and he
> said that he has the same problem...anybody?...help???
>
>
It closes because it is finished.

If you want to see the result, you could either:

- Place another input("") after the print statement.
- Run the program from the command prompt (in which case you will probably
need to set the path)

-- 
Michael Connors
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090806/de141e63/attachment.htm>


More information about the Tutor mailing list