# Snippets - Python **Kind**:: #snippets-collection **Source**:: #from/vsnip **Generated by**:: [[ob-snippets]] **Snippets**:: 8 ## Import ➤ PyYAML (`iyaml`) ```python from yaml import load, dump try: from yaml import CLoader as Loader, CDumper as Dumper except ImportError: from yaml import Loader, Dumper ``` ## Import ➤ Path (`ipath`) ```python from pathlib import Path ``` ## Import ➤ NamedTuple (`inamedtuple`) ```python from typing import NamedTuple ``` ## Shebang ➤ Python3 (`shebang`) ```python #!/usr/bin/env python3 $0 ``` ## if __main__ (`ifmain`) ```python if __name__ == '__main__': ${0:main()} ``` ## os.walk (`walk`) ```python for root, dirs, files in os.walk(${1:dir}): ``` ## NamedTuple (`namedtuple`) ```python class ${1:Name}(NamedTuple): ``` ## ruff (`ruffignore`) ```python # ruff: noqa: ${1:E501} ```