Python
How-to
- Cast exceptions to string
- Catch multiple exceptions
- Check if a URL is absolute
- Compare three values
- Configure Flake8
- Convert a list to a dictionary
- Convert an image to bytes
- Create a temporary file
- Define Final class
- Download an image with
requests
- Dump an object as a JSON with preserving unicode(no
\u
things) - Emit two or more items for each iteration in list comprehension
- Get a reference to the current module
- Get the last item from a list or an iterator
- Get the root(toplevel) of the git repository
- Invoke a blocking process
- Invoke a non-blocking process
- Make a python CLI through
entry_points
- Pick a free port number
- Read a file except the first line
- Remove the fragment from a URL
- Run python simple web server for sharing files
- Save a clipboard image
- Scale image
- Set local variables in list comprehension
- Support command history(up-arrow reveals prev commands)
- Use
ProcessPoolExecutor
- Vendor(Embed) dependencies
- Wait until a host starts listening
- Write JSON data to a file
Discussions
- Absolute import vs implicit, explicit relative import
- Comparison by Types
- Data descriptors vs. non-data descriptors
- Functions and Methods
- How fast are exceptions?
- Import in function
- List Comprehension
- Using PIPE
- When the buffer is flushed?
- When to use shell=True
- Which distribution tool should I use?
__getattr__
vs.__getattribute__
__new__
vs__init__
getattr
,setattr
, Why need them?install_requires
vsrequirements.txt
items
,iteritems
,viewitems
raise MyException
vsraise MyException()
scripts
vsconsole_scripts
Reference
Index
- Built-in functions builtin/
- Classes class/
- Comparison comparison/
- Decorator decorator/
- Descriptors descriptor/
- Double underscores dunder/
- Encodings encoding/
- Exceptions exceptions/
- Flake8 flake8/
- GitPython gitpython/
- Import import/
- Meta classes meta/
- Pillow pillow/
- Requests requests/
- collections collections/
- concurrent concurrent/
- copy copy/
- dict dict/
- docstring docstring/
- errno errno/
- format format/
- http http/
- importlib importlib/
- io io/
- itertools itertools/
- json json/
- list list/
- logging logging/
- metapy: Python bindings for MeTA metapy/
- multiprocessing multiprocessing/
- operator operator/
- pathlib pathlib/
- pip pip/
- pkgutil pkgutil/
-
prompt_toolkit
prompt-toolkit/ - re re/
- set set/
- setuptools setuptools/
- socket socket/
- str str/
- subprocess subprocess/
- tempfile tempfile/
- urllib urllib/
- webbrowser webbrowser/
Tagged
- Boto3 /aws/boto3/
- Click /click/
- Flask /flask/
- Moto - Mock AWS Services /moto/
- NumPy /numpy/
- Pipenv /pipenv/
- PyCon 2017 /pycon-2017/
- PyQt /pyqt/
- Python Fire /python-fire/
- SQLAlachemy /sqlalchemy/
- Talk Python To me /talk-python-to-me/
- TensorFlow /tensorflow/
- Urwid /urwid/
- WSGI /wsgi/
- Werkzeug /werkzeug/
- Zappa /zappa/
- fabric /fabric/
- lxml /lxml/
- mypy /mypy/
- pexpect /pexpect/
- pyenv /pyenv/
- pytesseract /pytesseract/
- pytest /pytest/
- python-vlc /python-vlc/
- twine /twine/