KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
How do I reference a file relatively to a package's directory? My directory structure is: /foo package1/ resources/ __init__.py package2/ resources/ __init__.py script.py script.py imports packages package1 and package2 . Although the packages can be imported by any other script on the system. How should I reference resources inside, say, package1 to ensure it would work in case os.path.curdir is arbitrary?
Tags (comma-separated)
Save Edits
Cancel