The Python 3.3 equivalent of 'execfile' -


i need find out how open .py files after writing them in notepad++. find interface more useful python window.

in tutorial following along guy uses

execfile(pathway) 

but execfile not work in 3.3.

is there equivalent statement in 3.x?

open file, read it, , pass contents exec:

with open('file.py') source_file:     exec(source_file.read()) 

Comments

Popular posts from this blog

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

ruby on rails - Authlogic - how to make a registration and don't log in the new account? -