/weird-snippets

Collection of Python 3 snippets that are fun and weird

Primary LanguagePython

weird-snippets

Collection of Python 3 snippets that are fun and weird


call_methods_iteratively.py

is an example of calling methods iteratively.
In this particular case, an image is plotted
and the title is set by using map and getattr.

further use: store a plot or plotting style in JSON


try_except_concurrent_wrapper.py

is an example of trying to perform an action,
in this case running a Flask App in any port
available given a list of preferences, and
attempting to do it while using try-except,
a global counter and a concurrent wrapper.

further use: try-except anything for a fixed-number of times