Keeping the Console Open with IDLE

S

summerholidaylearning

I'm using IDLE for editing, but execute programs directly. If there are
execution or "compile" errors, the console closes before I can see what it
contains. How do I prevent that?
--
W. eWatson

(121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
Obz Site: 39° 15' 7" N, 121° 2' 32"W, 2700 feet

Web Page: <www.speckledwithstars.net/>

Thanks this solved my problem too(the same issue - I was also double clicking instead of right clicking - edit with IDLE - F5 to run)
 
R

Rodrick Brown

I think you can use pythonw.exe which will read stdin and for any
input before closing.

(I read this a while back, ma guy here.)

Sent from my iPhone
 
R

rantingrickjohnson

I'm using IDLE for editing, but execute programs directly. If there are
execution or "compile" errors, the console closes before I can see what it
contains. How do I prevent that?

Q: If you are in fact using IDLE to edit your code file, then why not just "run" the files directly from the IDLE menu (Menu->Run->Run Module)? If youselect this command, IDLE will display a shell window containing all the stdout and stderr messages. I think this would be the easiest approach for aneophyte administrator like yourself. See this tutorial for more info:

https://hkn.eecs.berkeley.edu/~dyoo/python/idle_intro/index.html

There are many methods of executing a python script. Using the IDLE "run" command is just one of them. Some others include:

1. Double clicking the file icon in a file browser
2. Typing the full path of the script into a windows Command Prompt. Considering i have a script in my "C drive" named "foo.py", i could type the command "C:\foo.py" to execute the script from a windows command prompt.

But my fingers don't need any exercise, so i just double click the icon or use the "run" command of my IDE. Done deal.
 
R

rantingrickjohnson

What I meant was open open the command prompt, type cd, space, DO NOT
hit enter yet. Drag the folder with your script into the command prompt
window. Then go to the command prompt window and hit enter. This
should compose a command similar to the following:

And why the hell would you resort to such contrived contortions as that? Are you masochistic? DoubleClicking an icon will take me less that one second. How long does this sequence take:

1. Open a command prompt
2. type "c"
3. type "d"
4. type "space"
5. hover over the folder icon with your mouse
5.5. Oops, i missed. Go back to step 5!
6. Mouse click the file "icon"
7. Mouse drag the file "icon"
8. Position the mouse over prompt window
9. Release the "icon"
10. Press the "Enter" key

Can anybody say "!Ay, caramba!"?

Besides, you can skip most of those steps by Shift+RightClicking the file icon and choosing "Open Command Window Here". But, why the hell would you EVEN do that when two simple clicks will suffice?

"practicality beats purity"
 
C

Chris Angelico

Besides, you can skip most of those steps by Shift+RightClicking the file icon and choosing "Open Command Window Here".

That's not standard. Me, I can invoke git bash anywhere I want it, but
that doesn't mean I'd recommend installing git just so that people can
get command lines with less steps.

ChrisA
 
R

Rick Johnson

That's not standard. Me, I can invoke git bash anywhere I want it, but
that doesn't mean I'd recommend installing git just so that people can
get command lines with less steps.

I don't understand Chris? It's obvious that the OP is on a windows box; for which no installation is required.

And, what is so egregious about "less steps"(sic)? Do you prefer to be unproductive? Did you forget the lazy programmers creed? Is your employer paying you by the hour? ...all good questions.
 
R

Rick Johnson

That's not standard. Me, I can invoke git bash anywhere I want it, but
that doesn't mean I'd recommend installing git just so that people can
get command lines with less steps.

I don't understand Chris? It's obvious that the OP is on a windows box; for which no installation is required.

And, what is so egregious about "less steps"(sic)? Do you prefer to be unproductive? Did you forget the lazy programmers creed? Is your employer paying you by the hour? ...all good questions.
 
C

Chris Angelico

I don't understand Chris? It's obvious that the OP is on a windows box; for which no installation is required.

I have here a Windows XP system (shh, it doesn't know there's Linux
between it and the hardware) which has no such context-menu item. Ergo
it is not standard and cannot be assumed to be on the target computer,
and installation IS required.
And, what is so egregious about "less steps"(sic)? Do you prefer to be unproductive? Did you forget the lazy programmers creed? Is your employer paying you by the hour? ...all good questions.

And if you're going to quibble about "fewer steps" then you should
probably have an apostrophe in "lazy programmers' creed". Just sayin'.

ChrisA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,708
Latest member
SherleneF1

Latest Threads

Top