Python Scripting - MacOS, Linux and Unix

Published: 14 November 2023
on channel: Alexander Farrell
39
3

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, duration hours minute second in high quality that is uploaded to the channel Alexander Farrell 14 November 2023. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 39 times and liked it 3 visitors.