> Pros (-m over runpy.py, in order of significance as I see it): > - easy to combine with other Python command line options The script approach can do this too > - OS & environment independent So is the script -- probably more so, since the script can use Python's OS independence layer. > - easier to use with a non-installed interpreter > - no work for Python packaging folks No contest. > - more concise to invoke Depends on the length of the name of the script. :-) > - no namespace issues with naming a script Actually, one-letter options are a much scarcer resource than script names. > - C API for those embedding python And who needs that? > Cons: > - YACLO (Yet Another Command Line Option) > - CPython specific (other interpreters could choose to reimplement) Additional Pros for using a script: - less code to maintain - can work with older Python versions - shows users how to do a similar thing themselves with additional features (e.g. a common addition I expect will be to hardcode a personal sys.path addition) PS a big honking -1000 on Carlos Ribeiro's suggestion of doing this automatically if the filename path isn't found. Too many chances for accidentally invoking the wrong thing -- including mysyerious silences when the named module happens to exist but doesn't do anything when run as a script (i.e. the majority of modules). (As an aside, I wonder why every single of Carlos' interactions starts of with an idea that is completely misguided and then ends with him vehemently defending it against all opposition. Sounds like a recipe for flame wars to me.) -- --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4