python.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Mon, 22 Feb 2016 12:41:52 +0200
changeset 1903 901e7394849f
parent 1369 06b695810e88
child 1905 fba288d59662
permissions -rw-r--r--
Decrease intent to increase space usage on mobile.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1334
9bf0d5a1f0cf Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1298
diff changeset
     1
.. -*- coding: utf-8; -*-
9bf0d5a1f0cf Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1298
diff changeset
     2
.. include:: HEADER.rst
1013
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     3
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     4
========
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
 Python
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
========
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     7
.. contents::
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     9
Licence and history of Python.
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    10
==============================
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    11
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    12
  http://docs.python.org/dev/license.htm
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    13
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    14
Byte compile .py and check for errors.
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    15
======================================
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    16
::
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    17
1190
26fd684df3ee Generate documentation from Python sources by pydoc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1014
diff changeset
    18
  $ python -m compileall $dir
1013
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    19
1014
4716ec9e29f5 Install python modules/packages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1013
diff changeset
    20
Install python modules/packages.
4716ec9e29f5 Install python modules/packages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1013
diff changeset
    21
================================
4716ec9e29f5 Install python modules/packages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1013
diff changeset
    22
4716ec9e29f5 Install python modules/packages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1013
diff changeset
    23
  http://wiki.python.org/moin/CheeseShopTutorial
4716ec9e29f5 Install python modules/packages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1013
diff changeset
    24
                Installing Distributions from the Python Package Index (Start Here)
4716ec9e29f5 Install python modules/packages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1013
diff changeset
    25
1013
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    26
Uninstall python modules.
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    27
=========================
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    28
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    29
Install again and save list of installed files::
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    30
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    31
  $ python setup.py install --record files.txt
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    32
  $ rm `cat files.txt`
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    33
1014
4716ec9e29f5 Install python modules/packages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1013
diff changeset
    34
  http://peak.telecommunity.com/DevCenter/EasyInstall#uninstalling-packages
4716ec9e29f5 Install python modules/packages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1013
diff changeset
    35
                Uninstalling Packages
4716ec9e29f5 Install python modules/packages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1013
diff changeset
    36
1190
26fd684df3ee Generate documentation from Python sources by pydoc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1014
diff changeset
    37
Generate documentation from Python sources.
26fd684df3ee Generate documentation from Python sources by pydoc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1014
diff changeset
    38
===========================================
26fd684df3ee Generate documentation from Python sources by pydoc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1014
diff changeset
    39
26fd684df3ee Generate documentation from Python sources by pydoc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1014
diff changeset
    40
Generate documentation from Python sources by pydoc.
26fd684df3ee Generate documentation from Python sources by pydoc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1014
diff changeset
    41
----------------------------------------------------
26fd684df3ee Generate documentation from Python sources by pydoc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1014
diff changeset
    42
::
26fd684df3ee Generate documentation from Python sources by pydoc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1014
diff changeset
    43
26fd684df3ee Generate documentation from Python sources by pydoc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1014
diff changeset
    44
  $ mkdir html
26fd684df3ee Generate documentation from Python sources by pydoc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1014
diff changeset
    45
  $ cd html
26fd684df3ee Generate documentation from Python sources by pydoc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1014
diff changeset
    46
  $ pydoc -w ../
26fd684df3ee Generate documentation from Python sources by pydoc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1014
diff changeset
    47
26fd684df3ee Generate documentation from Python sources by pydoc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1014
diff changeset
    48
Generate documentation from Python sources by epydoc.
26fd684df3ee Generate documentation from Python sources by pydoc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1014
diff changeset
    49
-----------------------------------------------------
26fd684df3ee Generate documentation from Python sources by pydoc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1014
diff changeset
    50
26fd684df3ee Generate documentation from Python sources by pydoc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1014
diff changeset
    51
Generate documentation from Python sources by Sphinx.
26fd684df3ee Generate documentation from Python sources by pydoc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1014
diff changeset
    52
-----------------------------------------------------
1369
06b695810e88 Generate documentation from Python sources by Sphinx.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
    53
::
06b695810e88 Generate documentation from Python sources by Sphinx.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
    54
06b695810e88 Generate documentation from Python sources by Sphinx.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
    55
  $ sudo apt-get install python-sphinx
06b695810e88 Generate documentation from Python sources by Sphinx.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
    56
  $ sudo apt-get install rst2pdf
1190
26fd684df3ee Generate documentation from Python sources by pydoc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1014
diff changeset
    57
1013
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    58
Code analyzers and style checkers.
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    59
==================================
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    60
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    61
Pylint.
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    62
-------
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    63
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    64
  http://www.logilab.org/857
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    65
  http://pypi.python.org/pypi/pylint
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    66
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    67
PyChecker.
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    68
----------
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    69
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    70
  http://pychecker.sourceforge.net/
49a5602070a9 Uninstall python modules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    71
1210
ed0ee1b5343c Pretty print under Python.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1190
diff changeset
    72
Debugging Python code.
ed0ee1b5343c Pretty print under Python.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1190
diff changeset
    73
======================
ed0ee1b5343c Pretty print under Python.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1190
diff changeset
    74
ed0ee1b5343c Pretty print under Python.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1190
diff changeset
    75
Pretty print under Python.
ed0ee1b5343c Pretty print under Python.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1190
diff changeset
    76
--------------------------
ed0ee1b5343c Pretty print under Python.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1190
diff changeset
    77
::
ed0ee1b5343c Pretty print under Python.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1190
diff changeset
    78
ed0ee1b5343c Pretty print under Python.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1190
diff changeset
    79
  import pprint
ed0ee1b5343c Pretty print under Python.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1190
diff changeset
    80
  print(pprint.pformat('string'))
ed0ee1b5343c Pretty print under Python.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1190
diff changeset
    81
  print(pprint.pformat(['1', '2']))
ed0ee1b5343c Pretty print under Python.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1190
diff changeset
    82
1211
02aabbf45b59 Fix formatting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1210
diff changeset
    83
See:
02aabbf45b59 Fix formatting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1210
diff changeset
    84
1210
ed0ee1b5343c Pretty print under Python.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1190
diff changeset
    85
  http://docs.python.org/library/pprint.html
ed0ee1b5343c Pretty print under Python.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1190
diff changeset
    86
                Doc page.
ed0ee1b5343c Pretty print under Python.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1190
diff changeset
    87
1298
1e7db170c823 Trace Python execution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1211
diff changeset
    88
Trace Python execution.
1e7db170c823 Trace Python execution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1211
diff changeset
    89
=======================
1e7db170c823 Trace Python execution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1211
diff changeset
    90
1e7db170c823 Trace Python execution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1211
diff changeset
    91
  http://python-ptrace.hachoir.org/trac
1e7db170c823 Trace Python execution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1211
diff changeset
    92
                python-ptrace by Victor Stinner
1e7db170c823 Trace Python execution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1211
diff changeset
    93
  http://subterfugue.org/
1e7db170c823 Trace Python execution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1211
diff changeset
    94
                subterfugue
1e7db170c823 Trace Python execution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1211
diff changeset
    95