Mega Code Archive

 
Categories / Python Tutorial / Buildin Function
 

Exec can accept a valid file object to a (valid) Python file

f = open('test.py')        # open the file exec f                     # execute the file