Skip to main content

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)

Source distribution for importfa 0.5
File Size Uploaded
importfa-0.5.tar.gz 2.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for importfa 0.5
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.5 This release

2 release files

0.4

1 release file

0.3

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page