Linked Questions
12 questions linked to/from Python - Get path of root project structure
46 votes
8 answers
106k views
How to open an HTML file in the browser from Python?
I am trying to open an HTML file from Python but my script just displays the contents of the HTML file in Python instead of opening it in the browser. How can I fix this problem? How can I open the ...
67 votes
2 answers
43k views
using __init__.py
I am having difficulty understanding the usage scenarios or design goals of python's __init__.py files in my projects. Assume that I have 'model' directory (refers as a package) which contains the ...
11 votes
3 answers
35k views
Python access to project root directory
Below folder structure of my application: rootfolder /subfolder1/ /subfolder2 /subfolder3/test.py my code inside of the subfolder3. But I want to write output of the ...
12 votes
2 answers
14k views
How do I get the current 'package' name? (setup.py)
How do I get the current topmost package, i.e., the name defined in setup.py? Here is my tree: . |-- README.md |-- the_project_name_for_this_pkg | |-- __init__.py | |-- __main__.py | |-- ...
11 votes
1 answer
4k views
Python equivalent of R "here" package
Is there a Python equivalent for this library? https://github.com/r-lib/here/
3 votes
1 answer
6k views
including python file from project root in setup.py build
I am trying to include a python file in the build/lib directory created when running python setup.py install In particular, I would like to include a simple configuration file ('definitions.py') that ...
0 votes
3 answers
9k views
How to get project's root path inside my package?
I am trying to create one distributable package in Python.So in my package I need to access a file from the root of the project for which my package is installed inside. I am trying to do that like ...
0 votes
2 answers
3k views
Testing with configuration files
my Google-fu has failed me by giving me results I don't understand, so I'm asking here. I'm working on a Python project and I currently have a configuration file, which is also .py, that holds various ...
0 votes
1 answer
209 views
How to get absolute path of root directory from anywhere within the directory in python
Let's say I have the following directory model_folder | | ------- model_modules | | | ---- __init__.py | | | ---- foo.py | | | ---- ...
1 vote
0 answers
165 views
Appropriate python project setup for accessing paths relative to the project root folder out of a module in src
Example project structure: |-setup.toml |-README.md |-tests/... |-data/... |-src/ |-package1 |-package2 |-module1.py |-package3 |-subpackage4 |-module2.py ...
0 votes
1 answer
124 views
opoening data using pandas in python 3.7
hi i tried to open some data that i downloaded to my documents using pandas with python 3.7 but it doesnt work this is my code : import pandas as pd users=pd.read_csv("ml-100k/u.user",sep=...
0 votes
1 answer
78 views
How to get the project `config/` directory from inside an installed Python package?
I have a Python database interface package, which requires configured credentials to work. I would like to tuck those away in a config file, that's not committed to the interface repository. So I have ...