Skip to content

crazyguitar/pysheeet

Repository files navigation


pysheeet

Build Status Coverage License MIT DOI

Introduction

This project was started to bring together useful Python code snippets that make coding faster, easier, and more enjoyable. You can explore all the cheat sheets at Pysheeet. Contributions are always welcome—feel free to fork the repo and submit a pull request to help it grow!

What’s New In Python 3

This part only provides a quick glance at some important features in Python 3. If you're interested in all of the most important features, please read the official document, What’s New in Python.

Cheat Sheet

Core Python fundamentals including data types, functions, classes, and commonly used patterns for everyday programming tasks.

System

Date/time handling, file I/O, and operating system interfaces.

Concurrency

Threading, multiprocessing, and concurrent.futures for parallel execution. Covers synchronization primitives, process pools, and bypassing the GIL.

Asyncio

Asynchronous programming with Python's asyncio module. Covers coroutines, event loops, tasks, networking, and advanced patterns.

C/C++ Extensions

Native extensions for performance-critical code. Covers modern pybind11 (used by PyTorch, TensorFlow), ctypes, cffi, Cython, and the traditional Python C API. Also includes a guide for Python developers learning modern C++ syntax.

Security

Modern cryptographic practices and common security vulnerabilities. Covers encryption, TLS/SSL, and why legacy patterns are dangerous.

Network

Low-level network programming with Python sockets. Covers TCP/UDP communication, server implementations, asynchronous I/O, SSL/TLS encryption, and packet analysis.

Database

Database access with SQLAlchemy, Python's most popular ORM. Covers connection management, raw SQL, object-relational mapping, and common query patterns.

PyTorch

Deep learning with PyTorch and distributed training on HPC clusters. Covers tensor operations, neural networks, and job scheduling with Slurm.

Appendix

Supplementary topics covering Python internals, debugging techniques, and language features that don't fit elsewhere.

PDF Version

pdf

How to run the server

$ virtualenv venv
$ . venv/bin/activate
$ pip install -r requirements.txt
$ make
$ python app.py

# URL: localhost:5000

About

Python Cheat Sheet

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 44