This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo "waiting for the following arguments: username + max-page-number" | |
exit 1 | |
else | |
name=$1 | |
fi | |
if [ -z "$2" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Simple example of building your own context manager. | |
Resources: | |
- http://preshing.com/20110920/the-python-with-statement-by-example/ | |
- https://docs.python.org/3/library/contextlib.html | |
- PEP 343 -- the "with" statement: https://www.python.org/dev/peps/pep-0343/ | |
""" |