Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in Python by (45.3k points)

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?

1 Answer

0 votes
by (16.8k points)

Use this exec(open("./filename").read()) instead of this execfile("./filename") 

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.1k users

Browse Categories

...