Importing modules in python script and figuring out layout of directory/package -
i new python...and have been reading around trying figure out better answer... still struggling.
i trying import script code talking each other. i've tried importing suggested via python documentation:
from somepackage.somefile import object
the actual directory looks this
foo/ ├── bin │ ├── readme.txt ├── setup.py ├── development.ini ├── somepackage │ ├── somefile │ │ ├── __init__.py │ │ ├── object.py │ ├── __init__.py
do need import in .py file with? each module has empty init.py file. should move program located?
any appreciated!!
i figured out issue! need create setup.py document created packages , modules!
setup( #contents packages=['somepackage', 'somepackage.someotherpackage'], py_modules=['somepackage.module.file.py'], scripts=['bin/somescript-cmd'], #more code...
Comments
Post a Comment