Sep-22-2017, 08:03 PM
If scripts are in same folder or in jamics.py in PYTHONPATH.
C:\foo\ |-- jamics.py |-- run.py
# jamics.py def jam(): return ("Jamics Imported !...")
# run.py import jamics # using module jamics print(jamics.jam())Test:
Output:C:\foo
λ python run.py
Jamics Imported !..
Placing jamics.py in a place Python do not search(sys.path).import sys # Before import jamics sys.path.append('C:/somefolder/anotherfolder') import jamics # using module jamics print(jamics.jam())