Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #101867
| From | eryk sun <eryksun@gmail.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: how do I put the python on my desktop or even access it |
| Date | 2016-01-17 18:45 -0600 |
| Message-ID | <mailman.82.1453077981.15297.python-list@python.org> (permalink) |
| References | <DUB408-EAS19552177F791097AFA0C686D8CE0@phx.gbl> <569BAD24.4030700@gmail.com> <CACL+1auZHqWrFCny1eDRu+BodMqfBw-f2pQF1=f_qjgWksk1wA@mail.gmail.com> <569C2C5D.2070901@gmail.com> |
On Sun, Jan 17, 2016 at 6:05 PM, Michael Torrie <torriem@gmail.com> wrote: > On 01/17/2016 02:46 PM, eryk sun wrote: >> On Sun, Jan 17, 2016 at 9:03 AM, Michael Torrie <torriem@gmail.com> wrote: >>> >>> but if it's a text-mode program you must run it from cmd.exe like this: >>> >>> python \path\to\myprogram.py. >> >> You only need to run from another console program to keep the window >> open after Python exits. You can even do that in other ways, but doing >> that is more complicated than it is useful. > > Yes, but then we'll get the OP posting to ask why his python program > doesn't run. When he double-clicks his Py file it pops up briefly then > disappears! (Unless the code waits for user input of course). I was attempting to clarify the language that one "must run it from cmd.exe". This only needs to be done if you need to keep the window open after a console program has exited. Also, it doesn't have to be cmd.exe. You can use powershell.exe, bash.exe, another instance of python.exe, etc -- any console program that lets you start a child process and wait for it to exit. >> BTW, each console window is hosted by an instance of conhost.exe. >> There's nothing special about cmd.exe with respect to the console. > > Of course, but I doubt very many people know about conhost.exe. And > conhost.exe is rather useless in and of itself unless you have something > to run on it. Thus the usual way to get a console window that you can > actually work with is to run cmd.exe. I seriously doubt you would tell > a newbie to somehow use conhost.exe to run his program. I often come across even experienced Windows programmers on Stack Overflow who somehow have drawn the conclusion that cmd.exe *is the console*. I take whatever opportunity I can get to correct this misunderstanding with a little FYI note. For a newbie, I would of course suggest IDLE. I may also suggest changing the shebang to "#!python3 -i" while debugging a script. They can double-click on the script's icon to run it, and after it's done executing or if there's an unhandled exception, they can inspect the result in the REPL.
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: how do I put the python on my desktop or even access it eryk sun <eryksun@gmail.com> - 2016-01-17 18:45 -0600
csiph-web