Hello! 

If you want to run a file with its path inside a `my_file` variable, you can 
also use `__import__(my_file)`. This will also avoid polluting your namespace, 
compared to Cade Brown’s answer. 

I have to admit, this is pretty hacky, but I think this is better than a plain 
`exec()`. You can always create your own `python_include()` function.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/6BTMJ5DOKXCQGOBRIJ6C3RVS46XJARX6/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to