Skip to content

Commit 1f62430

Browse files
committed
Add python example
1 parent 6efb6cd commit 1f62430

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,18 @@ After running the above command, the file ``program.py`` will contain the follow
6969
if __name__ == "__main__":
7070
main()
7171
72+
Use duckargs in python code
73+
===========================
74+
75+
If you want to use duckargs in your own script, you can use the ``duckargs.generate_python_code`` function,
76+
which accepts a list of command line arguments:
77+
78+
.. code:: python
79+
80+
import sys
81+
from duckargs import generate_python_code
82+
83+
python_code = generate_python_code(sys.argv)
7284
7385
Pitfalls
7486
========

0 commit comments

Comments
 (0)