# Python : Core : CLI
- [using/cmdline](https://docs.python.org/3/using/cmdline.html)
#### Interface Options
| Interface Option | Description | `sys.argv[ 0 ]` | `sys.path` |
| ---------------- | ------------------------------------------------------------------------------------ | ------------------------------ | ------------------------- |
| none | `-i` is implied | `""` | prepend PWD as `""` |
| `-` | read commands from STDIN; if STDIN is a tty, behaves the same as no interface option | `"-"` | prepend PWD as `""` |
| `<file>` | imports `<file>` as `"__main__"` | `"<script>"` | prepend file's parent dir |
| `<dir>` | imports `<dir>/__main__.py` as `"__main__"` | `"<dir>/__main__.py"` | prepend dir |
| `-c <command>` | | `"-c"` | prepend PWD as `""` |
| `-m <module>` | imports module as `"__main__"` | `"<module_path>"` | prepend PWD |
| `-m <package>` | imports `package/__main__.py` as `"__main__"` | `"<package_path>/__main__.py"` | prepend PWD |
> [!info]
> When a script is passed as the first argument or the `-c` option is used, Python enters interactive mode after executing the script or command — even when `sys.stdin` does not appear to be a terminal. The `PYTHONSTARTUP` file is not read.
#### Env Vars
###### PYTHONSTARTUP
If Python is run in interactive mode and the `PYTHONSTARTUP` env var exists and references a readable file, that file will be executed before the first interactive prompt in the same namespace that interactive commands are executed.
The convention is to name that file `.pythonrc.py`.
##### IPython-Specific
###### IPYTHONDIR
Determines where IPython will look for config and startup files. Defaults to `~/.ipython`. If it doesn't exist, it will automatically be created and initialized with a tree of files. Equivalent to argument `--ipython-dir`.
> [!warning]
> Due to a bug, you must use an absolute path when first creating and initializing the directory. Once it exists, you can shorten it to a relative path.