Get current working directory : import os result = os.getcwd() Get the directory of the script being run : import os … More How to get current directory in Python
All articles by UzLA
Install Humanize: pip3 install humanize N.B.! If you are NOT running VirtualEnv, then you have to prepend the install command … More How to install Humanize module for Python 3
Get the time of last modification : import humanize result = humanize.naturalsize(intSizeValue, binary=True) More information: How to install Humanize module for Python3 … More How to get human readable file size
Convert the number of seconds since the epoch import datetime, os result = datetime.datetime.fromtimestamp(os.path.getctime(timestamp)) DONE! Minimum Requirements and How-to: Python3, Pip3, … More How to humanize / make-readable epoc (UNIX) datetime
Get the time of last modification : import os result = os.path.getmtime(path) The function returns a value which is the number of … More How to get file creation and modification date and times in Python?
Add standard <hr /> tag. Bootstrap will style up it according to CSS. DONE!
Edit .gitignore to match directories and / or files you want to ignore Execute git rm –cached /path/to/file DONE! Minimum Requirements … More How to .gitignore committed files
To remove all “*.pyc” files from your project is a one-liner: It is a recursive command that will follow all … More How to remove all *.pyc files from a project with Bash
Create a MariaDB / MySQL database and user: N.B.! You need to be logged in to MariDB CLI / MySQL CLI … More How to create a MariaDB / MySQL database and user
Install PyBuilder : N.B.! If you are NOT running VirtualEnv, then you have to prepend the install command with sudo. pip3 … More How to install PyBuilder with Python 3