Python Utilities

python-utils
By Kang Chen

A python code snippet package for Espanso to reduce boilerplate code

python
development

Paste this command in a terminal to install the package

espanso install python-utils
Description
Source

Espanso Python Utils

A python code snippet package for Espanso to reduce boilerplate code.

Triggers

Trigger
Command
:pymain
def main() -> None:

if __name__ == "__main__":
main()
:pycls
class :
def __init__(self) -> None:


def method_1(self) -> None:
:pydef
def ():

return
:pymatch
match :
case :

case _:
:pytry
try:

except as e:
:pyboiler:args
import argparse

def main(args: argparse.Namespace) -> None:

if __name__ == "__main__":
parser = argparse.ArgumentParser()

parser.add_argument("")

args = parser.parse_args()
main(args)
:pyboiler:log
import logging

logger = logging.getLogger(name)

def main() -> None:
logger.debug("Logger working")

if __name__ == "__main__":
logging.basicConfig(level=logging.DEBUG, format="%(levelname)s %(asctime)s: %(message)s")

main()