Jump to content
  • Advertisement
Sign in to follow this  
coding insanity

Python problems.

This topic is 4835 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, You guys have solved every single one of my past problems and questions, and hopefully, that trend continues. :-D Anyway, just as background: I am running python 2.4, on windows xp professional. I have been using IDLE as my IDE, and have had no problems. I can run a script from inside IDLE's python shell. Now, the big thing is, when I try to run a script (*insertnamehere.py*) file, by double-clicking the icon, it comes up in the cmd prompt (which of course makes sense). Now, the part which doesn't make sense is that it will flash on the screen (the entire cmd prompt) and promptly disappear, leaving me staring at my desktop. I had this problem with C console programs but was able to rectify that by adding (here are the last 3 lines of program): getchar(0); return(0); } to the end of my program, making the console stay on the screen until a key was pressed. Is there an equivalent in python? Or is my problem something totally different?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Now, the part which doesn't make sense is that it will flash on the screen (the entire cmd prompt) and promptly disappear, leaving me staring at my desktop.


When you start a console application, the operating system will open a console - unless that application was started from a preexisting console. When the application terminates, the operating system will close and destroy that console.

Your solution was to prevent the application from terminating by making it wait on user input.

Quote:
Is there an equivalent in python?


Same as in C, but the function you want is raw_input.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!