File: PyManual.txt

package info (click to toggle)
wxpython3.0 3.0.2.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 482,760 kB
  • ctags: 518,293
  • sloc: cpp: 2,127,226; python: 294,045; makefile: 51,942; ansic: 19,033; sh: 3,013; xml: 1,629; perl: 17
file content (211 lines) | stat: -rw-r--r-- 6,587 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
===============
 The Py Manual
===============

-------------------------
 Py - Served Fresh Daily 
-------------------------

:Author: Patrick K. O'Brien
:Contact: pobrien@orbtech.com
:Organization: Orbtech_
:Date: $Date$
:Revision: $Revision$

.. _Orbtech: http://www.orbtech.com/

.. contents::


Introduction
============

This document will show you how to use the Py programs and the Py
library of Python source code modules.  Py is the new name for the
project that began as PyCrust.  Py is officially part of wxPython_,
and includes PyCrust, so PyCrust is no longer distributed separately.

.. _wxPython: http://www.wxpython.org/


Developer Reference
===================

Source code documentation for developers is available at:

http://www.orbtech.com/www/wx/epydoc/public/wx.py-module.html


What is Py?
===========

Besides being `a delicious dessert`_, Py is the name for a collection
of whimsically-named Python programs and modules that began as the
PyCrust project.  So Py is really several things: a set of standalone
programs, including the original PyCrust program, a library of Python
source code modules that can be used in your own programs, and as many
examples of bad "pie" puns as I can come up with.  (If you're going to
do something, you might as well do it all the way, right?)  Py uses
Python and wxPython, so it works equally well on Windows, Linux and
Mac OS X.

.. _a delicious dessert: http://www.wikipedia.org/wiki/Pie


PyCrust is dead! Long live Py!
==============================

This project began with a program I created called PyCrust - an
interactive, graphical Python shell, developed using the wxPython GUI
toolkit.  For about two years, PyCrust was hosted on SourceForge_.
Shortly after I created PyCrust, the wxPython folks started including
it in their distribution.  As the PyCrust project grew, it reached a
point where I thought the original PyCrust name was too confining.  I
was using the PyCrust code base to develop programs that weren't just
Python shells any more.

Around that same time, the wxPython folks asked me if I'd be willing
to move all my wxPython-related projects into the `wxPython CVS
repository`_, and become part of the wxPython_/wxWidgets_ developer team.
I decided the time was right to restructure the PyCrust project.
During the move, the PyCrust package was renamed to "py" (lowercase
"p") and the collection of programs and modules as a whole became
known as "Py" (with a capital "P").

.. _wxPython CVS repository: http://cvs.wxWidgets.org
.. _SourceForge: http://www.sf.net/projects/pycrust/
.. _wxWidgets: http://www.wxWidgets.org/

The original goal of PyCrust was to be the best interactive, graphical
Python shell (of course, I claimed it was the "flakiest" Python
shell).  And that was all I wanted it to be.  But little by little I
found myself developing a wider variety of tools for wxPython
applications.  Eventually I'll create a debugger (PySlice, perhaps)
and whatever else is needed to one day become a complete wxPython
application development environment (PyFactory?).  In the mean time,
PyCrust is still the flakiest Python shell, and the other Py programs
are equally tasty.

At this point, Py has standalone programs that include Python code
editors (PyAlaCarte and PyAlaMode), interactive Python shells (PyCrust
and PyShell), and a runtime wrapper (PyWrap).  The runtime wrapper
utility provides you with runtime introspection capabilities for your
wxPython programs without having to include PyCrust or PyShell in your
program, and without having to alter one line of your source code.

Py also contains a collection of modules that you can use in your own
wxPython applications to provide similar services, either for your own
use during development, or as an interface for users of your programs.
These modules are the same ones used by all the Py programs.  


Py standalone programs
======================

These are the standalone applications in the Py collection:

* PyAlaCarte
* PyAlaMode
* PyCrust
* PyFilling
* PyShell
* PyWrap


PyAlaCarte
==========

PyAlaCarte is a Python source code editor.  It is designed to have a
simple, single-file interface.  As a standalone application, it is
good for simple, short editing tasks.  But it is really meant to be
more of an example of how to embed the Py editor into a wxPython
application.


PyAlaMode
=========

PyAlaMode is a Python source code editor.  


PyCrust
=======

PyCrust is an interactive, Python shell.  But it's more than just a
shell.  It includes a tabbed notebook containing a namespace tree
(PyFilling), and several other things.


PyFilling
=========

PyFilling is a namespace viewer.  It isn't really useful as a
standalone program, but it does illustrate how to make use of the
underlying ``filling`` module.


PyShell
=======

PyShell is an interactive, Python shell.  It shares the same base code
as PyCrust, but doesn't have any of the extra features that appear in
the PyCrust notebook interface.

.. figure:: screenshots/PyShell.png

   PyShell running on Mandrake Linux.


PyWrap
======

PyWrap is a runtime utility that lets you run an existing wxPython
program with a PyCrust frame at the same time.  Inside the PyCrust
shell namespace, the local variable ``app`` is assigned to your
application instance.  In this way you can introspect your entire
application within the PyCrust shell, as well as the PyFilling
namespace viewer.  


Py modules
==========

Py was designed to be modular.  That means graphical code is kept
separate from non-graphical code, and many of the Py modules can be
used by other programs.  Likewise, other programs can supply some of
the modules needed by Py.  For example, you could supply a customized
interpreter module and plug it in to the PyCrust standalone
application.  As long as it supports the minimum functionality
required, PyCrust will work just as well with your interpreter as with
its default interpreter.


Projects using Py
=================

* `Conflict Solver`_
* Gnumed_
* PyGist
* PythonCard_
* RPy_
* SciPy_
* Sim42_
* wxGasp_

.. _Conflict Solver: http://conflictsolver.sourceforge.net/
.. _Gnumed: http://www.gnumed.org/
.. _PythonCard: http://www.pythoncard.org/
.. _RPy: http://rpy.sourceforge.net/
.. _SciPy: http://www.scipy.org/
.. _Sim42: http://www.sim42.org/
.. _wxGasp: http://linus.yorktown.arlington.k12.va.us/CS/APCSC/student_sites/David_Mayo/wxGasp


History of changes
==================

This section lists all the changes that have been made to the Py
programs and modules, since the beginning.

.. include:: ../wx/py/CHANGES.txt