-1

I am doing some multiprocessing work on python which isn't doable from a jupyter notebook. I have written the required functions in a .py file and I'm now importing it into my notebook.

How do I import this directly from the same folder without specifying the directory of where the file is in? This needs to be run-able on different PCs when sent to other people and thus I dont want to append the system path for my computer specifically.

import sys
#sys.path.append to get
sys.path.append()
from map_reducer import *

Thank you.

NMA
  • 25
  • 1
  • 5
  • 1
    Does this answer your question? [Python: wildcard subset import](https://stackoverflow.com/questions/17226390/python-wildcard-subset-import) – MFerguson Dec 04 '21 at 23:48

1 Answers1

0

You can import them with:

from FileNameWithOutTheDotPy import *

And then just run them like normal:

FunctionThatDoesStuff(var1,var2)

Note: They do need to be in the same directory for this to work.

NMA
  • 25
  • 1
  • 5
nagol12344
  • 48
  • 4