dire-0.1.3


توضیحات

Python equivalent of Perl's warn and die functions
ویژگی مقدار
سیستم عامل OS Independent
نام فایل dire-0.1.3
نام dire
نسخه کتابخانه 0.1.3
نگهدارنده []
ایمیل نگهدارنده []
نویسنده Ken Youens-Clark
ایمیل نویسنده kyclark@gmail.com
آدرس صفحه اصلی https://github.com/kyclark/dire
آدرس اینترنتی https://pypi.org/project/dire/
مجوز -
# dire Python equivalent of Perl's `warn`/`die` functions. # Synopsis ```` from dire import * warn("This will print to sys.stdout") die("This will `warn` and then `sys.exit(1)`") die("This will `warn` and then `sys.exit(2)`", exit_val=2) ```` # Description I miss having these two functions that in Perl. I find myself defining them in most every program I write, so I'm making this module so I can just `import` them. ## warn(msg) The `warn` function will simply `print(message, file=sys.stderr)`. ## die(msg, exit_val=1) The `die` function will call `warn` with a message and will then call `sys.exit` with the `exit_val` parameter. NB: In Unix, an exit value of `0` indicates no error. The default value of `die.exit_val` is 1 simply because it is not zero. You could choose to set `exit_val=0` to halt program execution without indicating an error. # Author Ken Youens-Clark <kyclark@gmail.com>


نحوه نصب


نصب پکیج whl dire-0.1.3:

    pip install dire-0.1.3.whl


نصب پکیج tar.gz dire-0.1.3:

    pip install dire-0.1.3.tar.gz