0

I'm not new to python, but somehow i never used that mechanic: For example: I have a python file test.py which looks like:

'''test.py'''
from anothertest import anothertestfunc
def test(a):
   return a

if i import that file in a jupyter notebook like:

[1] import test

how can i load that anothertestfunc-module in jupyter, so i can use it like

[1] import test
[2] anothertestfunc

for now i only get the errormessage "anotherfunc is not defined" that totally makes sense to me. But how is the proper way to import a py file,that also has modules imported inside, so i use that modules once loaded in jupyter?

thanks in advance

  • you can find answer in here https://stackoverflow.com/questions/49264194/import-py-file-in-another-directory-in-jupyter-notebook or https://stackoverflow.com/questions/50293427/import-custom-py-files-in-jupyter-notebook-for-anaconda3 – brain pinky Oct 26 '20 at 13:31
  • `test.anothertestfunc`? – hpaulj Oct 26 '20 at 15:25

0 Answers0