Make console stay

Editor
Nov 19, 2011 at 4:56 PM
print 'Hello World'

 
pressAnyKey = raw_input()



How to get rid off last line and make the console stay after F5?
Coordinator
Nov 20, 2011 at 12:57 AM

In Tools->Options->Python Tools->Advanced, you'll probably want to check both:

   Wait for input when process exits abnormally

   Wait for input when process exits normally

 

Nov 26, 2011 at 9:53 AM
Edited Nov 26, 2011 at 9:54 AM

I checked both,,,still cmd disappears. Using PTVS 1.1 alpha...could that be the issue?

.

Coordinator
Dec 1, 2011 at 1:19 AM

Are you using IronPython?  In .NET debugging mode we cannot control this behavior so the option doesn't work there.  You can switch to Python debugging in the project properties Debug page and it'll work (you lose mixed C#/Python debugging, but gain a better Python debugging experience).

Dec 3, 2011 at 1:05 PM

Hi,

setting "Interpreter Arguments" in Project Settings Debug to "-i" did the Trick for me. Now I would like to know how I can rout the output into the VS Python Interactive Console instead of a new cmd. See new Thread.

Editor
Jan 9, 2012 at 7:42 PM

I don't seem to have the "Advanced" menu under Python Tools.  I was hoping to turn this behavior off.  Assuming all the output goes to the console window I don't want to see a command shell window popping up (isn't that the whole point of the console window/integrated environment?).  However, STDERR doesn't seem to go to the console window in my case, so I can't really turn off the pop up window without losing information.  Any suggestions?

Coordinator
Jan 9, 2012 at 7:49 PM

Could you have missed the Options part?  Slightly confusing, but there's both Tools->Options->Python Tools and Tools->Python Tools.

You can also do Debug->Execute in Interactive which will run it in the REPL window which is built-in to VS.