EmbeddedPython

From Dash

Jump to: navigation, search

Python is available for debugging, or for creating new features via plugins using the EmbeddedPython Dash plugin.

Checkout from subversion.

Obtain the latest version of the EmbeddedPython dash plugin from the Dash svn repository.

cd ~/code/ame/dash-plugins
svn co svn+ssh://ame3.asu.edu/svn/Dash/plugins/EmbeddedPython


Build the plugin.

In Finder, double click the project file at ~/code/ame/dash-plugins/EmbeddedPython/EmbeddedPython.xcodeproj to open the project in Xcode.
Open the Build Results window: Build->Build Results. (shortcut: Command-Shift-B)
I recommend that the Active Build Configuration is set to Debug. (I suggest that because that is the configuration that receives the most testing.)
Click the Build button in the Build Results window. (shortcut: Command-B) Building the project will also install the plugin in the /Users/Shared/Dash/plugins folder.

Regarding PyObjC
PyObjC is the Python - Objective-C Bridge. To learn more about PyObjC, goto the project web site. Check out the documentation, especially the introduction to PyObjC.

Startup module
When the EmbeddedPython plugin loads, it looks for the file ~/.dash/dash.py. If it finds it, it will run that file in the python interpreter. This allows you to setup a default python environment in dash.

Python console
After EmbeddedPython loads, the Python console window will display.

Image:pythonconsole.jpg

Enter python code in the lower text box, and press <enter> to run the code in the python interpreter. Output will be displayed in the upper text box. You may use the <return> key to enter multiple lines of python code at a time. The commands will not be executed until you hit the <enter> key.

<option>-<up arrow> can be used to scroll back thru the history of commands. <option>-<down arrow> can be used to scroll forward thru the history of commands.

If you close the python console, you can redisplay the console using the menu command Tools->Python Console.