A simple package for parsing function arguments from the command line
Project description
ParseArgs
Example:
from parseargs import parseargs
def fun(firstname, lastname:str, number:int = 5):
print(f"Hello {firstname} {lastname}")
print(f"Your number is {number}")
number *= 2
print(f"Twice your number is {number}")
parseargs(fun)
Now on the command line, you can do:
python fun.py ricky bobby --number 5
Notice how it will print out 10. If you remove the annotation declaring the number an int, it will instead print out 55.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
parseargs-0.0.3.tar.gz
(1.8 kB
view hashes)
Built Distribution
Close
Hashes for parseargs-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3a0c4b62445ead14c4bdffe3711e819d696a78c8c21367b6852aabdc54a2d70 |
|
MD5 | b05bfd59f66b611e34b099199bcacd1c |
|
BLAKE2b-256 | 805e1be11f9dd781e4add94612b66b5f9a67d570d80aa8080e8f087b84f5598a |