Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 30th, 2006, 5:46 PM   #1
Xternal34
Newbie
 
Join Date: Mar 2006
Posts: 2
Rep Power: 0 Xternal34 is on a distinguished road
Keeping Window Open :\

K, I'm a complete noob when it comes to python. I have no experience in it what-so-ever. So you might be getting a lot of these posts from me... little lame things...

Now, how do you keep a python window open? When I do the print command, it doesn't stay open. Noobular, I know... but still. How?
Xternal34 is offline   Reply With Quote
Old Mar 30th, 2006, 6:20 PM   #2
jayme
Professional Programmer
 
jayme's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 495
Rep Power: 0 jayme is an unknown quantity at this point
Send a message via MSN to jayme
If python compilers are anything like c++, your program will execute then as soon as it's done, close. You can just ask for user input at the very end of your program, then it won't close.

If this isn't the problem you're having, my bad.
__________________

Quote:
Originally Posted by Mohamed Jihad
Durka durka!
Due to incorrect calculations during the middle ages, our calendar actually begins a few years after Jesus' birth. Thus the real 6/6/6 happened a few years back. The world already ended and you missed it.

Download Code::Blocks now!
jayme is offline   Reply With Quote
Old Mar 30th, 2006, 6:35 PM   #3
hydroxide
Programmer
 
Join Date: Apr 2005
Posts: 73
Rep Power: 4 hydroxide is on a distinguished road
Quote:
Originally Posted by Xternal34
Now, how do you keep a python window open? When I do the print command, it doesn't stay open. Noobular, I know... but still. How?
Assuming you're using windows, your python scripts are probably set up to run using <pythonw.exe>. If you run using <python.exe> instead, the window will need to be manually closed. Alternatively, run your script through IDLE or another IDE. Alternatively, make sure the last thing you do is raw_input("[MORE]").

-T.
hydroxide is offline   Reply With Quote
Old Mar 31st, 2006, 11:16 AM   #4
Dietrich
Professional Programmer
 
Dietrich's Avatar
 
Join Date: Feb 2005
Posts: 434
Rep Power: 4 Dietrich is on a distinguished road
Smile

Without the last line shown
# bla blah blah code here

raw_input("Press enter to go on ...")
your program will close quickly even when you use python.exe (eg. double click on the filename.py in Windows XP)!
IDEs have their own output window and keep showing the result.
__________________
I looked it up on the Intergnats!
Dietrich is offline   Reply With Quote
Old Apr 2nd, 2006, 9:22 PM   #5
hydroxide
Programmer
 
Join Date: Apr 2005
Posts: 73
Rep Power: 4 hydroxide is on a distinguished road
Quote:
Originally Posted by Dietrich
Without the last line shown... your program will close quickly even when you use python.exe (eg. double click on the filename.py in Windows XP)!
You're quite right. <boggle> I'm sure there was something that left CMD windows behind that needed to be manually closed, though - ??maybe in Win98?? - everything I've done in the last X years has been either through IDLE or pythonw.exe.

-T.
hydroxide is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:11 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC