Python – an alternative to execfile in Python 3

pythonpython-3.x

It seems they canceled in Python 3 all the easy way to quickly load a script by removing execfile()

Is there an obvious alternative I'm missing?

Best Answer

According to the documentation, instead of

execfile("./filename") 

Use

exec(open("./filename").read())

See: