Real Python Guide

repository·master·Indexed 12 days ago

https://github.com/realpython/python-guide

Educational guides and scenarios for learning Python, featuring instructions on building command-line applications, configuring editors like Vim and Atom for PEP 8, and managing environments using pyenv, virtualenv, Pipenv, and virtualenvwrapper. Includes setup guides for interactive shells such as IPython, bpython, and ptpython.

Tokens
38K
Snippets
146
Records
221
Agent score
99%

What's inside Real Python Guide

  1. Overview of the Scientific Python Ecosystem

    master
    Python is a primary language for high-performance scientific computing due to its ease of use and integration with high-performance external libraries (written in C or Fortran). The ecosystem relies on a stack of specialized libraries for array manipulation, mathematical functions, plotting, and data analysis. For a deep dive into these tools, refer to the Python Scientific Lecture Notes.
  2. Overview of Buildout

    master
    Buildout is an open-source software build tool written in Python. It follows the principle of separating configuration from the setup scripts. It is primarily used to download and set up dependencies in the Python eggs format for software development or deployment. Users can create custom recipes for specific build tasks in various environments.
  3. Overview of C/C++ Interfacing Tools

    master

    When choosing a method to interface Python with C/C++, consider these primary tools:

    • CFFI: Best for simple ABI compatibility (dynamic loading) or building C extension modules. Works with CPython and PyPy.
    • ctypes: The standard library approach for CPython. Provides access to native OS APIs (like kernel32 on Windows or libc on *nix) and allows manual definition of structs/unions.
    • SWIG: A tool-based approach that generates bindings from header files. Powerful for exposing large C++ codebases to Python, including the ability to extend classes via interface files.
    • Boost.Python: A more manual but highly capable library for C++. It allows accessing PyObjects in C++, extracting SWIG wrappers, and embedding Python code within C++ applications.
  4. Overview of Python GUI Frameworks

    master

    This guide provides an alphabetical list of various Python libraries used for building Graphical User Interfaces (GUIs), ranging from native OS bindings to cross-platform toolkits.

    Cross-Platform Toolkits

    • Kivy: A library for multi-touch enabled, media-rich applications. It is based on OpenGL and supports Linux, OS X, Windows, and Android.
    • PySide / PyQt: Python bindings for the Qt Framework. Note that PyQt may require a commercial license if your software is not GPL-compliant.
    • PySimpleGUI: A wrapper for Tkinter and Qt designed for rapid development.
    • Toga: A native, OS-native, cross-platform toolkit that provides a shared interface for macOS, Windows, Linux (GTK), Android, and iOS.
    • wxPython: A wrapper for the wxWidgets C++ library.
    • Tkinter: A thin object-oriented layer on top of Tcl/Tk. It is included in the Python standard library, making it the most convenient and compatible option.

    Platform-Specific Frameworks

    • Cocoa / PyObjC: Only available on OS X. Do not use these for cross-platform applications.
    • PyGObject (PyGi): Provides Python bindings for the GNOME software platform and is fully compatible with GTK+ 3. (Note: PyGTK is deprecated and should be replaced by PyGObject).
  5. Choose a Python library for creating Command-line Applications

    master

    When building a Command-line Application (or Console Application), you can choose from several Python libraries depending on your complexity requirements and preferred development style:

    • Click: A highly configurable "Command-Line Interface Creation Kit" designed for composability with minimal code and sensible defaults.
    • docopt: A lightweight, Pythonic approach that creates interfaces by parsing POSIX-style usage instructions.
    • Plac: A simple, declarative wrapper over the standard library argparse. It infers the argument parser from your code, making it ideal for quick scripts and sysadmins.
    • Cliff: A framework designed for building multi-level command structures (like git or svn) using setuptools entry points for subcommands and output formatters.
    • Cement: An advanced, feature-full framework suitable for everything from micro-framework needs to complex, large-scale CLI applications.
    • Python Fire: A library by Google that automatically generates a CLI from any Python object, useful for debugging, exploring code in a REPL, or transitioning between Python and Shell.
  6. Use IDLE for small Python experiments

    master

    IDLE is an integrated development environment included in the Python standard distribution. It is written in Python using the Tkinter GUI toolkit. While not intended for full-scale application development, it is useful for testing small code snippets and experimenting with Python features.

    Key features include:

    • A Python Shell window (interpreter)
    • A multi-window text editor with Python syntax colorization
    • Minimal debugging capabilities
  7. Overview of ZeroMQ for distributed systems

    master
    ZeroMQ (also spelled ØMQ, 0MQ, or ZMQ) is a high-performance asynchronous messaging library designed for scalable distributed or concurrent applications. Unlike traditional message-oriented middleware, ZeroMQ can operate without a dedicated message broker. It provides a message queue using a familiar socket-style API.