According to the documentation, instead of
execfile("./filename")
Use
exec(open("./filename").read())
See:
More Related Contents:
- code that count the amount of yes and no in a list [closed]
- how to unpack a tuple in this form (‘abc’, [20, 20])? [closed]
- How to pass arguments to a Button command in Tkinter?
- Combine several images horizontally with Python
- Using Python 3 in virtualenv
- Pygame is running slow
- Unpickling a python 2 object with python 3
- Removing the TK icon on a Tkinter window
- Concurrent.futures vs Multiprocessing in Python 3
- Installing Python 3 on RHEL
- Python TypeError: non-empty format string passed to object.__format__
- Count number of words per row
- Tkinter: How to get frame in canvas window to expand to the size of the canvas?
- How do I use a PyGame timer event? How to add a clock to a pygame screen using a timer?
- cleanest way to call one function on a list of items
- Get folder name of the file in Python
- Sorting list by an attribute that can be None
- pythoncom crashes on KeyDown when used hooked to certain applications
- Nested list comprehension scope
- How PyCharm imports differently than system command prompt (Windows)
- time.time vs. timeit.timeit
- How do the scoping rules work with classes?
- Leading zeros are not allowed in Python?
- Identifying the data type of an input
- Can’t import annotations from __future__
- What should I put in the body of an abstract method?
- How to close the Python turtle window after it does its code?
- Performing len on list of a zip object clears zip [duplicate]
- Python3 project remove __pycache__ folders and .pyc files
- How to properly use the “choices” field option in Django