Skip to content

Instantly share code, notes, and snippets.

@emptymalei
Created August 13, 2019 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emptymalei/bf33d053eae3b23a1cca68bcc435b6ee to your computer and use it in GitHub Desktop.
Save emptymalei/bf33d053eae3b23a1cca68bcc435b6ee to your computer and use it in GitHub Desktop.
weird python
python
import os
__cwd__ = os.getcwd()
__location__ = os.path.realpath(
os.path.join(__cwd__, os.path.dirname(__file__))
)
print(f'location: {__location__}')
print(f'filename: {__file__}')
with open(os.path.join(__location__, __file__),'r') as fp:
content = fp.read()
print(content)
exec(content)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment