pythonw.exe

R

Ronald Reynolds

Dear Python Friends:
in my python directory there is a python.exe file which I understand completely but there is also a pythonw.exe DOS seems to honor the pythonw
command (No error message) but nothing happens. What is pythonw.exe?
Also is there a way to invoke idle from the DOS prompt? I tried idle filename.py and just idle. Is there any .exe for idle?

Sincerely, 'Ron "bumpker" Reynolds'
 
I

Irmen de Jong

Dear Python Friends:
in my python directory there is a python.exe file which I understand completely but there is also a pythonw.exe DOS seems to honor the pythonw
command (No error message) but nothing happens. What is pythonw.exe?
Also is there a way to invoke idle from the DOS prompt? I tried idle filename.py and just idle. Is there any .exe for idle?

Sincerely, 'Ron "bumpker" Reynolds'

pythonw.exe is the same as python.exe but it doesn't open a console window, and launches
python in the background. This allows you to easily run background programs or GUI
programs in a nicer way (without a dummy console window popping up).

Idle has no .exe as far as I know but you can start it like this:

pythonw -m idlelib.idle

You could create an alias or batch file called 'idle' that does this.

Irmen
 
N

Nobody

in my python directory there is a python.exe file which I understand
completely but there is also a pythonw.exe DOS seems to honor the pythonw
command (No error message) but nothing happens. What is pythonw.exe?

Windows distinguishes between "console" and "GUI" executables. python.exe
is a console executable, pythonw.exe is a GUI executable. One difference
is that GUI executables don't have stdin/stdout/stderr, so you can't use
pythonw.exe as an interactive interpreter.

The main use for pythonw.exe is if you write a GUI program in Python
(using e.g. TkInter, wxPython, etc) and you want it to be able to run it
from an icon (desktop, start menu) without it opening a console window
(running a console executable from an icon will open a console window).
Also
is there a way to invoke idle from the DOS prompt? I tried idle
filename.py and just idle. Is there any .exe for idle?

"C:\Program Files (x86)\Python27\Lib\idlelib\idle.py" filename.py

.... or similar, depending upon where Python is installed.

BTW, unless you're using Windows 95/98/ME, you don't have a
"DOS Prompt". The command prompt in Windows NT/2000/XP/Vista/7 isn't DOS.
 
C

Chris Angelico

BTW, unless you're using Windows 95/98/ME, you don't have a
"DOS Prompt". The command prompt in Windows NT/2000/XP/Vista/7 isn't DOS.

I don't see this as any sloppier than referring to "opening a
<whatever> prompt" when you mean "opening up a windowed command
interpreter". The command interpreter in NT+ uses an interface that
derives from the original DOS command interpreter, and a lot of people
consider it to be as primitive (not realising that it has a lot of
features, eg tab completion, that are WAY better even than
command+doskey); it's a lot closer to Unix's bash than to MS-DOS's
command. (I do prefer bash, though.)

ChrisA
 
T

Thorsten Kampe

* Chris Angelico (Sun, 14 Aug 2011 16:52:05 +0100)
I don't see this as any sloppier than referring to "opening a
<whatever> prompt" when you mean "opening up a windowed command
interpreter".

You're misunderstanding what people mean by "DOS prompt". They don't
mean "this is the DOS command shell", they mean "this is DOS".

Thorsten
 
H

harrismh777

Thorsten said:
You're misunderstanding what people mean by "DOS prompt". They don't
mean "this is the DOS command shell", they mean "this is DOS".

.... yup, ... was helping my little sis with her iMac over the phone from
four states away and had her open a terminal for some magic... and it
took her exactly 1.03 seconds to say, "Oh, the iMac has DOS installed in
the utilities folder!" :-O

.... blondes... :-}


(she tries hard, and actually has been learning, so, we keep trying...)
 
C

Chris Angelico

... yup, ... was helping my little sis with her iMac over the phone from
four states away and had her open a terminal for some  magic... and it took
her exactly 1.03 seconds to say, "Oh, the iMac has DOS installed in the
utilities folder!"   :-O

... blondes...   :-}

Just to confuse things even further, it's not unlikely that a Mac or
Linux or Windows computer will have DOSBox installed. Is *that* DOS?
Technically no, but practically yes.

ChrisA
 
S

Seebs

Just to confuse things even further, it's not unlikely that a Mac or
Linux or Windows computer will have DOSBox installed. Is *that* DOS?
Technically no, but practically yes.

Depending on how you define "unlikely", I'd guess it is.

Assume that "unlikely" means roughly the equivalent of "if I were optimizing,
I'd use a compiler branch prediction hint at this point". :)

-s
 
T

Terry Reedy

The main use for pythonw.exe is if you write a GUI program in Python
(using e.g. TkInter, wxPython, etc) and you want it to be able to run it
from an icon (desktop, start menu) without it opening a console window
(running a console executable from an icon will open a console window).

In particular, IDLE runs in a pythonw process and it executes user code
in a separate pythonw process and usually uses a socket for the connection.
 
D

Dennis Lee Bieber

Just to confuse things even further, it's not unlikely that a Mac or
Linux or Windows computer will have DOSBox installed. Is *that* DOS?
Technically no, but practically yes.
Depends... "DOS", to me, is just short for "Disk Operating
System"... I've source code (in a book) for K2FDOS, source code for
LS-DOS 6, and have used the AmigaDOS component of AmigaOS (granted --
AmigaDOS technically was the part of the OS that gave access to the I/O
system, and included the command line interpreter...).

"DOS" does not automatically mean "MicroSoft DOS"...

I have less experience with "MS-DOS" than I have with LS-DOS and
AmigaDOS.

What most call "DOS" is, to me, merely a "command line interpreter"
(CLI).
 
C

Chris Angelico

       Depends... "DOS", to me, is just short for "Disk Operating
System"... I've source code (in a book) for K2FDOS, source code for
LS-DOS 6, and have used the AmigaDOS component of AmigaOS (granted --
AmigaDOS technically was the part of the OS that gave access to the I/O
system, and included the command line interpreter...).

       "DOS" does not automatically mean "MicroSoft DOS"...

I would say that DOS can, in a Windows context, mean either MS-DOS or
a generic Disk Operating System. The latter sense is no more
appropriate to the CLI than the former; in a modern OS, the part that
truly "operates the disk" would be either the kernel or the hard disk
driver, depending on your point of view, and neither of those has any
sort of UI.
       What most call "DOS" is, to me, merely a "command line interpreter"
(CLI).

And that's really what we have. A shell. A CLI. A textual command
parser (as opposed to a graphical action system which is what most
GUIs are). It's more similar to a MUD than to an operating system -
first space-separated word is a verb, everything else is modifiers.

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

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top