How to import class in the current directory into other python script

reference: http://stackoverflow.com/questions/4142151/python-how-to-import-the-class-within-the-same-directory-or-sub-directory

create empty file called __init__.py
with following content to load mixpanel.py(contains Mixpanel class)
Write following where you want to load the class Mixpanel in pgreport.py
from mixpanel import Mixpanel

No comments:

Post a Comment