I'm writing a Python script that is only meant to be run from the console. e.g.: $> myscript
.
I'm wondering what is the leading conventions in Python for scripts of this sort. Should I call it myscript
, or myscript.py
?
I'm writing a Python script that is only meant to be run from the console. e.g.: $> myscript
.
I'm wondering what is the leading conventions in Python for scripts of this sort. Should I call it myscript
, or myscript.py
?
Why?
Python scripts in Linux environments are recognized as such, but NT is... special. If there's ever a need to move it to anything made by microsoft, you need the extension.
Appending a filename extension to it will make it obvious what kind of file it is, for when others look in your directories.
If ever you need to call it into python as a module, you NEED the .py extension.
It is the standard for all python scripts to have the .py or .pyc extension on them.