![Previous Page](../icons/previous.gif) |
![Up One Level](../icons/up.gif) |
![Next Page](../icons/next.gif) |
Macintosh Library Modules |
![Contents](../icons/contents.gif) |
![Module Index](../icons/modules.gif) |
![Index](../icons/index.gif) |
1.2.3 Simulating command line arguments
There are two ways to simulate command-line arguments with MacPython-OS9.
- via Interpreter options
- Hold the option-key down when launching your script. This will
bring up a dialog box of Python Interpreter options.
- Click ``Set Unix-style command line..'' button.
- Type the arguments into the ``Argument'' field.
- Click ``OK''
- Click ``Run''.
- via drag and drop
If you save the script as an applet (see Section 1.3.4), you
can also simulate some command-line arguments via
``Drag-and-Drop''. In this case, the names of the files that were
dropped onto the applet will be appended to
sys.argv
, so that
it will appear to the script as though they had been typed on a
command line. As on Unix systems, the first item in sys.srgv
is
the path to the applet, and the rest are the files dropped on the
applet.
![Previous Page](../icons/previous.gif) |
![Up One Level](../icons/up.gif) |
![Next Page](../icons/next.gif) |
Macintosh Library Modules |
![Contents](../icons/contents.gif) |
![Module Index](../icons/modules.gif) |
![Index](../icons/index.gif) |
Release 2.3.3, documentation updated on December 19, 2003.
See About this document... for information on suggesting changes.