.pyw files
Tim Peters
tim.one at comcast.net
Thu Jan 30 10:54:09 EST 2003
[Skip Montanaro]
> If I understand correctly, .pyw files on Windows are plain old
> source files,
Yes.
> but prevent console window popup when executed.
Due to file association magic: .py is associate with python.exe, and .pyw
with pythonw.exe. There's nothing like pythonw.exe on, e.g., a Linux box.
You could get the same effect with a .py file by running it with pythonw.exe
instead of with python.exe. The entire difference is that python.exe uses
the main() in Module\python.c, but pythonw.exe compiles WinMain() in
PC\WinMain.c instead.
> Do they byte compile to .pyc files?
If imported, yes.
> Or does that question not make sense?
It depends on the use to which you put the answer <wink>.
> (Is the .pyw suffix only useful when it's the main application program,
> double-clicked by the user?)
Double-clicking isn't the only way to launch one of these, but yes, the
entire difference is in whether main() or the Windows-specific WinMain() is
used to get Python started.
More information about the Python-list
mailing list