Jump to content

Python: Difference between revisions

143 bytes removed ,  7 January 2021
Line 566: Line 566:


Alternatively, there are also Python bindings for ggplot2<br>
Alternatively, there are also Python bindings for ggplot2<br>
===Pillow (PIL)===
<code>pip install pillow</code>
This is a very useful library for loading images.
You can also load images using matplotlib, OpenCV, or Tensorflow.


===configargparse===
===configargparse===
Line 584: Line 578:
If you want to use bools without store-true or store-false, you need to define an str2bool function:
If you want to use bools without store-true or store-false, you need to define an str2bool function:
[https://stackoverflow.com/questions/15008758/parsing-boolean-values-with-argparse Stack Overflow Answer]
[https://stackoverflow.com/questions/15008758/parsing-boolean-values-with-argparse Stack Overflow Answer]
{{ hidden | str2bool |
<syntaxhighlight lang="python">
<syntaxhighlight lang="python">
def str2bool(val):
def str2bool(val):
Line 607: Line 602:
                     default=False)
                     default=False)
</syntaxhighlight>
</syntaxhighlight>
}}