The previous post was for commands Unix. This post is about the Python commands I use or Google frequently.

  1. To find the absolute path of the directory of the current file being executed -

abs_path = os.path.dirname(os.path.realpath(__file__))