python newbie

Anthony Borla ajborla at bigpond.com
Fri Jan 9 00:44:37 EST 2004


"broebel" <computer.problemen at skynet.be> wrote in message
news:3ffddcfd$0$16662$ba620e4c at news.skynet.be...
> hey,
>
> I'm a newbie in the programming world.
> I just started and already I'm in a whole lot of problems.
>

And you'll probably experience a whole host more - welcome to the wonderful
world of programming ;) !!!

>
> first problem is the fact that I started out with a little program
> who was part of a course but the problem is when I launch
> the program. I don't have the time to see the result because
> the screen closes immediately.
>
> Can anyone explain what's happening.
>
<SNIP CODE>

You are obviously not launching the interpreter from a console window. Thus,
launching the interpreter forces a new console window to be opened, your
program executes, and it then closes because it has finished.

Possible remedies allowing you to view your program's output:

* Launch interpreter as you have been doing, but add a line
   such as:

       raw_input("Press a key to continue ")

   at the end of your code to prompt for a key press before
   exiting, and closing the console window

* Start using the intepreter from a console window i.e. start
   using the command line. All generated output will appear
   on the same console.

   Since you are in a course [?] I'd recommend asking your
   instructor about suitable tutorials for doing this

I hope this helps.

Anthony Borla





More information about the Python-list mailing list