Skip to content

Commit 100a2ad

Browse files
author
Kenneth Reitz
committed
2 parents a1f0e9b + 8c6fdc8 commit 100a2ad

3 files changed

Lines changed: 56 additions & 5 deletions

File tree

docs/scenarios/gui.rst

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,29 @@ http://www.riverbankcomputing.co.uk/software/pyqt/download
1717

1818
Cocoa
1919
:::::
20+
*Note: The Cocoa framework is only available on Mac OSX. Don't pick this if you're writing a cross-platform application!*
2021

2122
PyObjC
2223
------
23-
*Note: Only available on Mac OSX. Don't pick this if you're writing a cross-platform application.*
24+
PyObjC 2.0 is included in the default python installation of Mac OS X 10.5 Leopard.
25+
To install the latest version: ::
26+
$ pip install pyobjc
27+
or go to http://pyobjc.sourceforge.net/downloads.html
2428

2529
WXPython
2630
::::::::
2731
Install (Stable)
2832
----
2933
*Go to http://www.wxpython.org/download.php#stable and download the appropriate package for your OS.*
34+
The simplest method to test if it works is to attempt to import it. ::
35+
Aarons-MacBook:docs aaron$ python
36+
Python 2.6.6 (r266:84374, Aug 31 2010, 11:00:51)
37+
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
38+
>>> import wx
39+
Traceback (most recent call last):
40+
File "<stdin>", line 1, in <module>
41+
ImportError: No module named wx
42+
If you don't get the above error, WXPython is installed.
3043

3144
Gtk
3245
:::

docs/starting/which-python.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ Which Python to use?
66

77
2.x vs 3.x
88
::::::::::
9-
9+
http://wiki.python.org/moin/Python2orPython3
1010

1111

1212
History
1313
-------
14-
14+
Python2.0 was released October 16, 2000. Python3.0 was released on December 3,2008 and breaks backwards compatibility.
1515

1616

1717
Today

docs/writing/documentation.rst

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,51 @@ The Basics
1111

1212
Code Comments
1313
-------------
14-
15-
14+
Information regarding code comments is taken from PEP 008 (http://www.python.org/dev/peps/pep-0008/).
15+
Block comment styling should be used when commenting out multiple lines of code.: ::
16+
17+
Block comments generally apply to some (or all) code that follows them,
18+
and are indented to the same level as that code. Each line of a block
19+
comment starts with a # and a single space (unless it is indented text
20+
inside the comment).
21+
Paragraphs inside a block comment are separated by a line containing a
22+
single #.
23+
24+
Inline comments are used for individual lines and should be used sparingly.: ::
25+
26+
An inline comment is a comment on the same line as a statement. Inline
27+
comments should be separated by at least two spaces from the statement.
28+
They should start with a # and a single space.
29+
Inline comments are unnecessary and in fact distracting if they state
30+
the obvious. Don't do this:
31+
x = x + 1 # Increment x
32+
But sometimes, this is useful: ::
33+
x = x + 1 # Compensate for border
1634

1735
Doc Strings
1836
-----------
37+
PEP 257 is the primary reference for docstrings. (http://www.python.org/dev/peps/pep-0257/)
38+
|There are two types of docstrings, one-line and multi-line. Their names should be fairly self explanatory.
39+
|One-line docstrings: ::
40+
41+
def kos_root():
42+
"""Return the pathname of the KOS root directory."""
43+
global _kos_root
44+
if _kos_root: return _kos_root
45+
...
46+
47+
Multi-line docstrings: ::
48+
49+
def complex(real=0.0, imag=0.0):
50+
"""Form a complex number.
1951

52+
Keyword arguments:
53+
real -- the real part (default 0.0)
54+
imag -- the imaginary part (default 0.0)
2055

56+
"""
57+
if imag == 0.0 and real == 0.0: return complex_zero
58+
...
2159

2260
Sphinx
2361
::::::

0 commit comments

Comments
 (0)