how to open python shell code example Example: python fuction execute a script site:realpython.com >>> exec(open('hello.py').read()) 'Hello World!'