Command-Line Parameters
PythonWin supports a number of command-line parameters as shown in this table.
|
Command Line |
Description |
|
|
Starts PythonWin and opens the named file for editing. |
|
|
Starts PythonWin and runs the specified script. |
|
|
Must be the first parameter. Starts PythonWin without DDE support, allowing for multiple PythonWin instances. |
|
|
Treats the named file as a PythonWin application. This is for advanced users only and is discussed in Chapter 20. |
By default, PythonWin allows only one instance to be open. If you
attempt to start a new instance of PythonWin, the existing instance
is reused, primarily to support better integration with Windows
Explorer, as described later in this chapter. PythonWin uses
Dynamic Data Exchange (DDE) to communicate
between instances, so the /nodde parameter can
disable this behavior and allow as many
PythonWin instances as you
care to start.
To demonstrate these command lines, close the source file pywindemo.py (leave PythonWin running) and start a command prompt window. Enter the command:
C:\Somewhere> start pythonwin.exe /edit C:\Scripts\pywindemo.py
You should see your existing PythonWin application come to the foreground, and see pywindemo.py opened for editing. Switch back to the command prompt and enter the command:
C:\Somewhere> start pythonwin.exe /run c:\Scripts\pywindemo.py
You should see the same messages printed as when you ran the script directly from PythonWin. Finally, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access