Cheat Sheet:
1. Write Python
2. Shebang (#! python3)
3. Make executable (chmod +x whatever.py)
4. Move to $PATH folder, or add folder to PATH
Alternatively, you can set up aliases in your shell instead of adding to a folder in $PATH.
If you have trouble with the shebang, run whereis python3 to detect where python is installed on your machine.
Documentation on OS Module:
https://docs.python.org/3/library/os....
Documentation on SYS Module:
https://docs.python.org/3/library/sys...
Timestamps
00:00 Demonstration
00:42 Create a Python Script
01:45 Add a shebang
02:12 Optional: Remove file extension
02:32 Make executable with chmod
03:20 Test
03:34 Command line arguments with sys module
05:25 Path variable
09:04 Other languages with the shebang
09:18 OS Module in Python
11:56 Thank you
Watch video Python Scripting - MacOS, Linux and Unix online without registration, duration hours minute second in high quality. This video was added by user Alexander Farrell 14 November 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 39 once and liked it 3 people.