0

If I have a python file contains lines as below :

### my_library.py
#---------
import Test1 as test 
import Test2 as tst
import project1 as prj
#---------

and I want to make these modules defined in all my other files in the same directory. I want to make these imports as general imports for the system's python. If I add the file path in PYTHONPATH enviroment varaible nothing will happen. Any suggestions please ?

Raghad Qu
  • 51
  • 1
  • 3
  • I want to make it able to use in any other file for example ( test.getArguments() ) – Raghad Qu Nov 22 '18 at 09:27
  • this has surely been answered here. https://stackoverflow.com/questions/16852811/python-how-to-import-from-all-modules-in-dir – MEdwin Nov 22 '18 at 09:29
  • 1
    IIUC you just need an `__init__.py` file in that directory. The file itself can be empty. It's not totally clear to me what you mean in your question. – roganjosh Nov 22 '18 at 09:29
  • I want to make it able to use the imported modules in the file above in all other files without importing them – Raghad Qu Nov 22 '18 at 09:34

0 Answers0