Skip to content

Instantly share code, notes, and snippets.

@z0gSh1u
Last active March 3, 2025 05:57
Show Gist options
  • Select an option

  • Save z0gSh1u/a10e6c2715af05c44306e40921d485a9 to your computer and use it in GitHub Desktop.

Select an option

Save z0gSh1u/a10e6c2715af05c44306e40921d485a9 to your computer and use it in GitHub Desktop.
Node.js __dirname equivalent in Python
import os.path as path
# dirname__ will be the absolute directory that current .py file is in
dirname__ = path.dirname(path.abspath(__file__))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment