Python

Updated: 29 December 2024

Run a python script inside a file

python3 my-script.py

Run a python script as if were an executable program

#!/usr/bin/env python3

from datetime import datetime

now = datetime.today().strftime('%Y-%m-%d %H:%M:%S')
print(now)