Skip to content

Instantly share code, notes, and snippets.

@ymcdull
Created April 14, 2016 14:32
Show Gist options
  • Save ymcdull/8da81afef32be350137a897fb21df2da to your computer and use it in GitHub Desktop.
Save ymcdull/8da81afef32be350137a897fb21df2da to your computer and use it in GitHub Desktop.
Using 'os' module to get the filename
import os
if __name__ == "__main__":
fname = os.path.basename(__file__)
print fname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment