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