SourceForge Logo

 

PAGE - Python Automatic GUI Generator - Version 4.4.4

  Short Description
  Systems Supported
  Installation
  Documentation
  Download
  Some Elisp that makes EMACS a better Python IDE
    Extensions to python-mode.el
    Inserting python debugging print statements
    pycomplete
    Pymacs
  Small offerings for your consideration.
    Vrex - Visual regexp written in Python
    Adages that have served me well
  Author

Short Description

PAGE is an drag-and-drop GUI generator, bearing a resemblance to Visual Basic. It allows one to easily create GUI windows containing a selection of Tk and ttk widgets. Required are Tcl/Tk 8.5 and Python 2.7. I am actually using Tcl/Tk 8.6 and Python 2.7. PAGE springs from Virtual Tcl, a Tcl/Tk program, modified to generate a Python module that realizes the desired GUI. Tcl is required for running PAGE but is not required for executing the generated Python code.

PAGE is not an end-all, be-all tool, but rather one that attempts to ease the burden on the Python programmer. It is aimed at the user who will put up with a less than completely general GUI capability in order to get an easily generated GUI. A helper and learning tool, it does not build an entire application but rather is aimed at building a single GUI class and the boiler plate code in Python necessary for getting the GUI on the screen.

The 4.2 release is a major release incorporating an approach to the rework problem; i.e., how are you able to tweak the generated GUI without jeopardizing the handwritten code necessary to support the GUI. See the documentation which discusses the rework problem and the solution in version 4.2.

I have included within this project python-mode extensions which I wrote to enhance emacs as a Python IDE. They may be downloaded from the Summary Page.

Systems Supported

Currently PAGE and the resulting GUI windows have been tested on Linux running Python 2.7.2, and 3.2 running on Linux and on Win32.

It is important to know that a version of PAGE will require particular base versions of Python, and Tcl/Tk. You really better stick to the recommended versions.

Software versions utilized to test PAGE 4 are:

Tk Widgets supported:

as well as the following ttk widgets: and the scrolled widgets based on ttk widgets based on pyttk examples by Guilherme Polo:

Other features:

Installation

Installation is easier than ever because Python 2.7 and Python 3.2 include support for the themmed widgets (the ttk package). On Linux one downloads PAGE-4.2.tgz and expands it in a directory. In Windows one executes page-4.2.exe. At this point I strongly recommend Python 2.7. I am personally using Python 2.7.3. I recommend getting the installation packages directly form the Python Org page. (Remember to erase any .pagerc files that may be present.)

The prerequisites are Tcl/Tk 8.5.4 or later. Tcl/Tk 8.5.4 is needed for support of the ttk widgets and Python 2.7 to get a version of tkinter that works with the ttk widgets. (Tix is no only a memory as a requirement.) One should not install Pyttk because it is now included in Python 2.7. I recommend the free ActiveTcl 8.6.0 package for Tcl and Tk.

Tcl/Tk 8.5.2 or later is needed to run PAGE but is not needed to execute the generated Python code.

Documentation

Users Documentation which is also included in the package. There is now an Epub version of the documentation.

I have recently (April 2012) included a 17MB pdf python-page.pdf containing two articles on the use of PAGE by Greg Walters which appeared in Full Circle Magazine.

The documentation on this site may be more recent than that included with the package. When a package is released, it will definitely include the most recent documentation and I always try to provide up-to-date documentation for all features released. If you have suggestions for improving the documentation I definitely would like to hear about them.

Download

To download Page, go to the Summary Page from which you can download the most recent version.

Some Elisp that makes EMACS a better Python IDE

I really like emacs and so I have hacked together some things that improve its usage for me. The most important is a package of extensions to python-mode.el. Also, I have written several functions which facilitate the insertion of debugging statements (pyp.el). More recently, I have fussed around with pycomplete and pymacs. Again, see python-mode extensions. All of these extensions are now available in the python-mode-extensions available on the Summary Page.

Extensions to python-mode.el

These are some simple extensions to python-mode.el that I recommend. Included are an improved mechanism for executing a python program from an emacs window. Functions are there to facilitate navigating the traceback stack in the event of an error.

Inserting python debugging print statements

I often need to insert debugging statements into my programs. To facilitate that I wrote several emacs functions. They are pyp for "python print", ppy for "pretty print python", and ppyi for "pretty print python include". pyp is activated by function key 12 (set in my .emacs file) and requests the expression to be printed. A line is then inserted into my code with the proper indentation and looks like

print "containing_class: containing_function: expression =", expression # user_name pyp
dpr: vTcl:create_functions: mod = ext.,
The trailing user_name and pyp are there to facilitate removing the statements at a later time.

The macros are in pyp.el. Comments at the beginning of the file show what is necessary to include in your .emacs file.

pycomplete

I must admit that I have not been using this facility recently. 2-19-2013

This is a nifty emacs extension which helps one to insert attributes and functions into a python program. For instance, one can type

os.path.is

and a window will open up showing all attributes and functions in os.path which begin with "is". Also, functions are can be distinguished from simple attributes because they are followed by "()". Pick one with the mouse and hit and the completion will take place. It is required that there be an appropriate include statement, in this case "os.path", in order for the completion to work. If it is not included one get a message the name is undefined.

I got an early version which was rather limited. Looking around the net, I found reference to an extension patch. When I applied the patch, I saw that it was better. So I removed some unnecessary code from the package and added the facility to distinguish functions and to end up in the python buffer after the completion. There are two pieces to the package - pycomplete.el which is loaded by emacs so must be in the emacs load path and pycomplete.py which should go into an active site-packages directory. As time goes on I am less enamored with this package but I still use the previous two every day.

Pymacs

Liking both python and emacs, I think that Pymacs is a great idea. I started looking more closely because pycomplete is built on Pymacs. Pymacs is another example of a great piece of code with lousy documentation. Recently, I found a site devoted to Pymacs; it provides downloads and documentation. Also, I found that Pymacs is in the Debian repositories.

The main problem I found was a paucity of examples.

TCl Debugging Functions

Similar to above I wrote a series of Tcl debugging functions which make it easier to insert debugging statements into a tcl program.

Small offerings for your consideration.

Vrex - Visual regexp written in Python

This is example code based on Visual REGEXP. It is a tool for constructing and testing Python regular expressions. It has been updated to use ttk::panedwindow's and it Vrex provides most of the obvious facilities of that program, hence the lower case in the name. It is a tool that I use all the time. It will run under Python 2.7 and 3.2.

Adages that have served me well

From a career of programming I have observed some things that have helped me quite a bit. See adages.

Author

I am Don Rozenberg. I encourage you to contact me with any problems, comments or suggestions. Keep those cards and letters coming.

Email: dpr: vTcl:create_functions: mod = ext.,