Given an equivalent way to achieve this but in import style, prevent formatter smash up your code
import xxx
if __name__=="__main__":
import os,sys
fa = os.path.abspath("/".join([sys.argv[0] + "/.."] + [".."] * 2))
sys.path.append(fa)
import xxx_local_package # similar to ..xxx
For short, this project does this:
| use this project | equivalent code | |
|---|---|---|
| import importfa.f | → | os.path.append(sys.argv[0] + "/../..") |
| import importfa.ff | → | os.path.append(sys.argv[0] + "/../../..") |
| import importfa.fff | → | os.path.append(sys.argv[0] + "/../../../..") |
| import importfa.fffff | → | os.path.append(sys.argv[0] + "/../../../../..") |
For convenience, import importfa.f8 is equivalent to importfa.ffffffff,etc.
Release files for importfa 0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| importfa-0.5.tar.gz | 2.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| importfa-0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.5 kB
Release files / importfa-0.5.tar.gz
| Download URL | importfa-0.5.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fb0ee27adcdf97b55a79c611076f7adeb38ffefdd27267d5f5f2195717679ce0
|
|
BLAKE2b-256 checksum How to use checksums |
ce41ebf7530738bf2fdf2e5ef64e086c2236d1fc5721c5c03a99287e473f1d90
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.13
|
Release files / importfa-0.5-py3-none-any.whl
| Download URL | importfa-0.5-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
adba7b0527b19458578a23bccca996e14b37dd7d7d48cc8ae7afb2c79ed12ca7
|
|
BLAKE2b-256 checksum How to use checksums |
98f08770295188e1361a5befa2c4cb0f4c9c9557250e60b40d737a337ba6d997
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.13
|