معرفی شرکت ها


current-path-0.0.4


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

A small library for getting current path data for a script that imports this library.
ویژگی مقدار
سیستم عامل -
نام فایل current-path-0.0.4
نام current-path
نسخه کتابخانه 0.0.4
نگهدارنده []
ایمیل نگهدارنده []
نویسنده jon-edward
ایمیل نویسنده arithmatlic@gmail.com
آدرس صفحه اصلی https://github.com/jon-edward/current_path
آدرس اینترنتی https://pypi.org/project/current-path/
مجوز -
# current_path ![badge][coverage_badge_link] `current_path` is a small library for getting current path data for a script that imports this library. ## Installation `pip install current-path` ## Usage Get the current file's path which imports `current-path`: ```python from current_path import current_file if __name__ == '__main__': print(current_file()) ``` Get the current directory's path which contains the file which imports `current-path`: ```python from current_path import current_dir if __name__ == '__main__': print(current_dir()) ``` Temporarily change the current working directory to the file's directory until the code block under the context manager has been completed: ```python from current_path import current_dir_as_cwd import os def create_file(path: str): with open(path, 'w'): """File has been created.""" if __name__ == '__main__': # CWD is some arbitrary directory. with current_dir_as_cwd(): # CWD is this file's directory. os.mkdir("file_directory") create_file("file_0.txt") # CWD returns to same arbitrary directory. ``` The above code ensures that, no matter which working directory the script is invoked from, the file is created in the same location. ## License Licensed under the [CC0 License](https://creativecommons.org/share-your-work/public-domain/cc0/). [coverage_badge_link]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/jon-edward/0cffc203e1e03b87f50004c11fd92543/raw/


زبان مورد نیاز

مقدار نام
>=3.6 Python


نحوه نصب


نصب پکیج whl current-path-0.0.4:

    pip install current-path-0.0.4.whl


نصب پکیج tar.gz current-path-0.0.4:

    pip install current-path-0.0.4.tar.gz