-2

I have two directory on same level

1.Scripts->(Inside it we have app.py file)
2. Keymaker-->(Inside it we have keymaker.py file)

Now I want to import keymaker.py in app.py, So how Can I do it

Flimzy
  • 68,325
  • 15
  • 126
  • 165

2 Answers2

-1

Write these lines in app.py file.

import sys
sys.path.append('path/to/Keymaker/dir')

After that you can import anything from keymaker.py file using from keymaker import *

Abhishek Jain
  • 504
  • 2
  • 4
  • 15
-2

Add empty __init__.py file to Keymaker directory and do from Keymaker import keymaker

matszwecja
  • 2,416
  • 1
  • 8
  • 12