mirror of
https://github.com/kennethreitz/python-guide.git
synced 2026-06-05 23:00:18 +00:00
Merge pull request #987 from davidshq/master
Updates to GUI and CLI Files
This commit is contained in:
+17
-18
@@ -5,13 +5,12 @@ Command-line Applications
|
|||||||
|
|
||||||
.. image:: /_static/photos/34435690330_11930b5987_k_d.jpg
|
.. image:: /_static/photos/34435690330_11930b5987_k_d.jpg
|
||||||
|
|
||||||
Command-line applications, also referred to as
|
Command-line applications, also referred to as `Console Applications
|
||||||
`Console Applications <http://en.wikipedia.org/wiki/Console_application>`_,
|
<http://en.wikipedia.org/wiki/Console_application>`_, are computer programs
|
||||||
are computer programs designed to be used from a text interface, such as a
|
designed to be used from a text interface, such as a `shell
|
||||||
`shell <http://en.wikipedia.org/wiki/Shell_(computing)>`_. Command-line
|
<http://en.wikipedia.org/wiki/Shell_(computing)>`_. Command-line applications
|
||||||
applications usually accept various inputs as arguments, often referred to as
|
usually accept various inputs as arguments, often referred to as parameters or
|
||||||
parameters or sub-commands, as well as options, often referred to as flags or
|
sub-commands, as well as options, often referred to as flags or switches.
|
||||||
switches.
|
|
||||||
|
|
||||||
Some popular command-line applications include:
|
Some popular command-line applications include:
|
||||||
|
|
||||||
@@ -29,9 +28,9 @@ Click
|
|||||||
*****
|
*****
|
||||||
|
|
||||||
`click <http://click.pocoo.org/>`_ is a Python package for creating
|
`click <http://click.pocoo.org/>`_ is a Python package for creating
|
||||||
command-line interfaces in a composable way with as little code as
|
command-line interfaces in a composable way with as little code as possible.
|
||||||
possible. This “Command-Line Interface Creation Kit” is highly
|
This “Command-Line Interface Creation Kit” is highly configurable but comes
|
||||||
configurable but comes with good defaults out of the box.
|
with good defaults out of the box.
|
||||||
|
|
||||||
|
|
||||||
******
|
******
|
||||||
@@ -50,8 +49,8 @@ Plac
|
|||||||
`Plac <https://pypi.python.org/pypi/plac>`_ is a simple wrapper
|
`Plac <https://pypi.python.org/pypi/plac>`_ is a simple wrapper
|
||||||
over the Python standard library `argparse <http://docs.python.org/2/library/argparse.html>`_,
|
over the Python standard library `argparse <http://docs.python.org/2/library/argparse.html>`_,
|
||||||
which hides most of its complexity by using a declarative interface: the
|
which hides most of its complexity by using a declarative interface: the
|
||||||
argument parser is inferred rather than written down by imperatively. This
|
argument parser is inferred rather than written down imperatively. This
|
||||||
module targets especially unsophisticated users, programmers, sysadmins,
|
module targets unsophisticated users, programmers, sysadmins,
|
||||||
scientists, and in general people writing throw-away scripts for themselves,
|
scientists, and in general people writing throw-away scripts for themselves,
|
||||||
who choose to create a command-line interface because it is quick and simple.
|
who choose to create a command-line interface because it is quick and simple.
|
||||||
|
|
||||||
@@ -72,12 +71,12 @@ sub-command to do the work.
|
|||||||
Cement
|
Cement
|
||||||
******
|
******
|
||||||
|
|
||||||
`Cement <http://builtoncement.com/>`_ is an advanced CLI Application Framework.
|
`Cement <http://builtoncement.com/>`_ is an advanced CLI Application
|
||||||
Its goal is to introduce a standard and feature-full platform
|
Framework. Its goal is to introduce a standard and feature-full platform for
|
||||||
for both simple and complex command line applications as well
|
both simple and complex command line applications as well as support rapid
|
||||||
as support rapid development needs without sacrificing quality.
|
development needs without sacrificing quality. Cement is flexible, and its use
|
||||||
Cement is flexible, and its use cases span from the simplicity of a micro-framework
|
cases span from the simplicity of a micro-framework to the complexity of a
|
||||||
to the complexity of a mega-framework.
|
mega-framework.
|
||||||
|
|
||||||
|
|
||||||
***********
|
***********
|
||||||
|
|||||||
+38
-37
@@ -14,8 +14,8 @@ Camelot
|
|||||||
*******
|
*******
|
||||||
|
|
||||||
`Camelot <http://www.python-camelot.com>`_ provides components for building
|
`Camelot <http://www.python-camelot.com>`_ provides components for building
|
||||||
applications on top of Python, SQLAlchemy, and Qt. It is inspired by
|
applications on top of Python, SQLAlchemy, and Qt. It is inspired by the Django
|
||||||
the Django admin interface.
|
admin interface.
|
||||||
|
|
||||||
The main resource for information is the website:
|
The main resource for information is the website:
|
||||||
http://www.python-camelot.com
|
http://www.python-camelot.com
|
||||||
@@ -33,19 +33,17 @@ Cocoa
|
|||||||
GTk
|
GTk
|
||||||
***
|
***
|
||||||
|
|
||||||
PyGTK provides Python bindings for the GTK+ toolkit. Like the GTK+ library
|
.. note:: PyGTK provides Python bindings for the GTK+ toolkit. However, it has been superseded by PyGObject. PyGTK should not be used for new projects and existing projects should be ported to PyGObject.
|
||||||
itself, it is currently licensed under the GNU LGPL. It is worth noting that
|
|
||||||
PyGTK only currently supports the Gtk-2.X API (NOT Gtk-3.0). It is currently
|
|
||||||
recommended that PyGTK not be used for new projects and that existing
|
|
||||||
applications be ported from PyGTK to PyGObject.
|
|
||||||
|
|
||||||
|
|
||||||
********************
|
********************
|
||||||
PyGObject aka (PyGi)
|
PyGObject aka (PyGi)
|
||||||
********************
|
********************
|
||||||
|
|
||||||
`PyGObject <https://wiki.gnome.org/Projects/PyGObject>`_ provides Python bindings which gives access to the entire GNOME software platform.
|
`PyGObject <https://wiki.gnome.org/Projects/PyGObject>`_ provides Python
|
||||||
It is fully compatible with GTK+ 3. Here is a tutorial to get started with `Python GTK+ 3 Tutorial <https://python-gtk-3-tutorial.readthedocs.io/en/latest/>`_.
|
bindings which gives access to the entire GNOME software platform. It is fully
|
||||||
|
compatible with GTK+ 3. Here is a tutorial to get started with `Python GTK+ 3
|
||||||
|
Tutorial <https://python-gtk-3-tutorial.readthedocs.io/en/latest/>`_.
|
||||||
|
|
||||||
`API Reference <http://lazka.github.io/pgi-docs/>`_
|
`API Reference <http://lazka.github.io/pgi-docs/>`_
|
||||||
|
|
||||||
@@ -56,8 +54,8 @@ Kivy
|
|||||||
|
|
||||||
`Kivy <http://kivy.org>`_ is a Python library for development of multi-touch
|
`Kivy <http://kivy.org>`_ is a Python library for development of multi-touch
|
||||||
enabled media rich applications. The aim is to allow for quick and easy
|
enabled media rich applications. The aim is to allow for quick and easy
|
||||||
interaction design and rapid prototyping, while making your code reusable
|
interaction design and rapid prototyping, while making your code reusable and
|
||||||
and deployable.
|
deployable.
|
||||||
|
|
||||||
Kivy is written in Python, based on OpenGL, and supports different input devices
|
Kivy is written in Python, based on OpenGL, and supports different input devices
|
||||||
such as: Mouse, Dual Mouse, TUIO, WiiMote, WM_TOUCH, HIDtouch, Apple's products,
|
such as: Mouse, Dual Mouse, TUIO, WiiMote, WM_TOUCH, HIDtouch, Apple's products,
|
||||||
@@ -101,52 +99,55 @@ http://www.riverbankcomputing.co.uk/software/pyqt/download
|
|||||||
|
|
||||||
|
|
||||||
*****************************
|
*****************************
|
||||||
PyjamasDesktop (pyjs Desktop)
|
Pyjs Desktop (formerly Pyjamas Desktop)
|
||||||
*****************************
|
*****************************
|
||||||
|
|
||||||
PyjamasDesktop is a port of Pyjamas. PyjamasDesktop is application widget set
|
Pyjs Desktop is a application widget set for desktop and a cross-platform
|
||||||
for desktop and a cross-platform framework. (After release v0.6 PyjamasDesktop
|
framework. It allows the exact same Python web application source code to be
|
||||||
is a part of Pyjamas (Pyjs)). Briefly, it allows the exact same Python web
|
executed as a standalone desktop application.
|
||||||
application source code to be executed as a standalone desktop application.
|
|
||||||
|
|
||||||
`Python Wiki for PyjamasDesktop <http://wiki.python.org/moin/PyjamasDesktop>`_.
|
|
||||||
|
|
||||||
The main website: `pyjs Desktop <http://pyjs.org/>`_.
|
The main website: `pyjs <http://pyjs.org/>`_.
|
||||||
|
|
||||||
|
|
||||||
**
|
**
|
||||||
Qt
|
Qt
|
||||||
**
|
**
|
||||||
|
|
||||||
`Qt <http://qt-project.org/>`_ is a cross-platform application framework that
|
`Qt <http://qt-project.org/>`_ is a cross-platform application framework that is
|
||||||
is widely used for developing software with a GUI but can also be used for
|
widely used for developing software with a GUI but can also be used for non-GUI
|
||||||
non-GUI applications.
|
applications.
|
||||||
|
|
||||||
|
|
||||||
***********
|
***********
|
||||||
PySimpleGUI
|
PySimpleGUI
|
||||||
***********
|
***********
|
||||||
|
|
||||||
`PySimpleGUI <https://pysimplegui.readthedocs.io/>`_ is a wrapper for Tkinter and Qt (others on the way). The amount of code required to implement custom GUIs is much shorter using PySimpleGUI than if the same GUI were written directly using Tkinter or Qt. PySimpleGUI code can be "ported" between GUI frameworks by changing import statements.
|
`PySimpleGUI <https://pysimplegui.readthedocs.io/>`_ is a wrapper for Tkinter
|
||||||
|
and Qt (others on the way). The amount of code required to implement custom
|
||||||
|
GUIs is much shorter using PySimpleGUI than if the same GUI were written
|
||||||
|
directly using Tkinter or Qt. PySimpleGUI code can be "ported" between GUI
|
||||||
|
frameworks by changing import statements.
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ pip install pysimplegui
|
$ pip install pysimplegui
|
||||||
|
|
||||||
PySimpleGUI is contained in a single PySimpleGUI.py file. Should pip installation be impossible, copying the PySimpleGUI.py file into a project's folder is all that's required to import and begin using.
|
PySimpleGUI is contained in a single PySimpleGUI.py file. Should pip
|
||||||
|
installation be impossible, copying the PySimpleGUI.py file into a project's
|
||||||
|
folder is all that's required to import and begin using.
|
||||||
|
|
||||||
|
|
||||||
****
|
****
|
||||||
Toga
|
Toga
|
||||||
****
|
****
|
||||||
|
|
||||||
`Toga <https://toga.readthedocs.io/en/latest/>`_ is a Python native, OS
|
`Toga <https://toga.readthedocs.io/en/latest/>`_ is a Python native, OS native,
|
||||||
native, cross platform GUI toolkit. Toga consists of a library of base
|
cross platform GUI toolkit. Toga consists of a library of base components with a
|
||||||
components with a shared interface to simplify platform-agnostic GUI
|
shared interface to simplify platform-agnostic GUI development.
|
||||||
development.
|
|
||||||
|
|
||||||
Toga is available on mOS, Windows, Linux (GTK), and mobile platforms such
|
Toga is available on mOS, Windows, Linux (GTK), and mobile platforms such as
|
||||||
as Android and iOS.
|
Android and iOS.
|
||||||
|
|
||||||
|
|
||||||
**
|
**
|
||||||
@@ -161,8 +162,8 @@ Both Tk and Tkinter are available on most Unix platforms, as well as on Windows
|
|||||||
and Macintosh systems. Starting with the 8.0 release, Tk offers native look and
|
and Macintosh systems. Starting with the 8.0 release, Tk offers native look and
|
||||||
feel on all platforms.
|
feel on all platforms.
|
||||||
|
|
||||||
There's a good multi-language Tk tutorial with Python examples at
|
There's a good multi-language Tk tutorial with Python examples at `TkDocs
|
||||||
`TkDocs <http://www.tkdocs.com/tutorial/index.html>`_. There's more information
|
<http://www.tkdocs.com/tutorial/index.html>`_. There's more information
|
||||||
available on the `Python Wiki <http://wiki.python.org/moin/TkInter>`_.
|
available on the `Python Wiki <http://wiki.python.org/moin/TkInter>`_.
|
||||||
|
|
||||||
|
|
||||||
@@ -170,12 +171,12 @@ available on the `Python Wiki <http://wiki.python.org/moin/TkInter>`_.
|
|||||||
wxPython
|
wxPython
|
||||||
********
|
********
|
||||||
|
|
||||||
wxPython is a GUI toolkit for the Python programming language. It allows
|
wxPython is a GUI toolkit for the Python programming language. It allows Python
|
||||||
Python programmers to create programs with a robust, highly functional
|
programmers to create programs with a robust, highly functional graphical user
|
||||||
graphical user interface, simply and easily. It is implemented as a Python
|
interface, simply and easily. It is implemented as a Python extension module
|
||||||
extension module (native code) that wraps the popular wxWidgets cross platform
|
(native code) that wraps the popular wxWidgets cross platform GUI library, which
|
||||||
GUI library, which is written in C++.
|
is written in C++.
|
||||||
|
|
||||||
**Install (Stable) wxPython**
|
**Install (Stable) wxPython**
|
||||||
*go to http://www.wxpython.org/download.php#stable and download the appropriate
|
*go to https://www.wxpython.org/pages/downloads/ and download the appropriate
|
||||||
package for your OS.*
|
package for your OS.*
|
||||||
|
|||||||
@@ -891,4 +891,4 @@ Further Reading
|
|||||||
***************
|
***************
|
||||||
|
|
||||||
- http://docs.python.org/3/library/
|
- http://docs.python.org/3/library/
|
||||||
- http://www.diveintopython.net/toc/index.html
|
- https://www.diveinto.org/python3/
|
||||||
|
|||||||
Reference in New Issue
Block a user