PDA

View Full Version : What is the difference between .py and .pyw ?



thenetduck
January 14th, 2007, 11:50 PM
Hi,
I was wondering if anyone knows the difference between .py and .pyw when making python applications? I am learning python and haven't found any real answer to this question. Thanks,

The Net Duck

jblebrun
January 14th, 2007, 11:52 PM
Hi,
I was wondering if anyone knows the difference between .py and .pyw when making python applications? I am learning python and haven't found any real answer to this question. Thanks,

The Net Duck

Googled for .pyw
Found:
http://filext.com/detaillist.php?extdetail=PYW

maddog39
January 15th, 2007, 01:35 AM
Its basically just a Python User Interface file. So a Python file that opens up a new Window without the command line.

ghostdog74
January 15th, 2007, 02:06 AM
pyw means run the script without invoking the console window, especially if your program is GUI based. If you rename the file to py extension,you still can run it.

Wybiral
January 15th, 2007, 06:35 AM
Weird... ghostdog74 and maddog39...

Anyway, trying to stay on topic... I didn't know "pyw" existed until this post!

ghostdog74
January 15th, 2007, 07:33 AM
not weird though, from what i know, in Python for windows, .pyw script is called by pythonw.exe. (as opposed to python.exe)

pravahshukla
April 14th, 2009, 01:54 AM
Well this is true that .py file runs on console basis that is using command prompt or terminal and .pyw files are used when you are building a GUI application and not a console application using Qt or Jython and some other tools which help in Python GUI programming

Sinkingships7
April 14th, 2009, 01:56 AM
not weird though, from what i know, in Python for windows, .pyw script is called by pythonw.exe. (as opposed to python.exe)

I think he meant "weird" as in both ghostdog and maddog posted a reply. ;)

KevOrr
September 30th, 2012, 04:08 PM
Well this is true that .py file runs on console basis that is using command prompt or terminal and .pyw files are used when you are building a GUI application and not a console application using Qt or Jython and some other tools which help in Python GUI programming

It's also a nice feature for when you want a script to be continuously running in the background, but don't want an ugly console getting in the way or risking that the user accidentally exits the script.