how to execute .py from python IDE code example Example: run python file using python code exec(open('file.py').read())