Caution newbie question: python window to stay open ?
Caution: newbie question I am using python 2.4.3-11 on Windows XP. Problem: Python window closes immediately after executing a *.py file (e.g. containing a "print..." command. What do I have to do to keep it open to see the results ? "Interactive window" stays open. Thank you. Michael -- http://mail.python.org/mailman/listinfo/python-list
Re: Caution newbie question: python window to stay open ?
mkengel wrote: > Caution: newbie question If you're pretty sure it's a common newbie question, then begin by going to the Google repository at: http://groups.google.com/group/comp.lang.python Search in the box at upper right, on, say, keep cmd window open, or keep dos window open. Like so: http://tinyurl.com/yfbtgx And you'll have answers going all the way back to antiquity. rd -- http://mail.python.org/mailman/listinfo/python-list
Re: Caution newbie question: python window to stay open ?
mkengel wrote: > Caution: newbie question If you're pretty sure it's a common newbie question, then begin by going to the Google repository at: http://groups.google.com/group/comp.lang.python Search in the box at upper right, on, say, keep cmd window open, or keep dos window open. Like so: http://tinyurl.com/yfbtgx And you'll have answers going all the way back to antiquity. rd -- http://mail.python.org/mailman/listinfo/python-list
Re: Caution newbie question: python window to stay open ?
mkengel wrote: > Problem: Python window closes immediately after executing a *.py file > (e.g. containing a "print..." command. > What do I have to do to keep it open to see the results ? Simple scripts that print to a console, or read from it, works best if you run them from a standard Command Prompt window. If you just click on a Python script in the explorer, Windows will create a temporary command window, and remove it when the program is done. This is standard Windows behaviour; to get around this in a general way, you need to write GUI-oriented Python programs (using e.g. Tkinter or wxPython), and run them using the "pythonw.exe" runtime. For simpler scripts, you can also add raw_input("Press return to close this window...") to the end of the script. For tips on running Python programs from the command prompt, this page might also be helpful: http://effbot.org/pyfaq/how-do-i-run-a-python-program-under-windows -- http://mail.python.org/mailman/listinfo/python-list
Re: Caution newbie question: python window to stay open ?
Michael, put this at the top of your code. After the window closes read the testLog.out file. It may give you a clue as to what is happening. sys.stdout = open('testLog.out', 'w') jim-on-linux http://www.inqvista.com On Tuesday 21 November 2006 22:20, mkengel wrote: > Caution: newbie question > > I am using python 2.4.3-11 on Windows XP. > Problem: Python window closes immediately after > executing a *.py file (e.g. containing a > "print..." command. What do I have to do to > keep it open to see the results ? > > "Interactive window" stays open. > > Thank you. > Michael -- http://mail.python.org/mailman/listinfo/python-list