Setting up MonoDevelop Python

This tutorial will step you through the process of getting MonoDevelop’s Python add-in ready to go. This tutorial does not cover how to retrieve and build a recent version of MonoDevelop from subversion. Information on that can be found on the MonoDevelop Wiki.

Step One

The first step is to create a new project. If you are not familiar with MonoDevelop, there is a handy start page when you start it up. Go ahead and select the “Start a new Solution” button.

Step Two

Lets go ahead and create a new sample project to play with. I choose to un-select the “Create separate Solution subdirectory” option as it does not pertain in the same way to python projects.

Step Three

Lets open up the project’s options and configure Python!

Step Four

Next we need to update the source code style to reflect Pythons PEP8. Forgetting this step will make Python’istas around you very unhappy. Select the Python Source code options in the preferences dialog. You need to change the Policy to be Custom.

Step Five

A few options need to be changed here. Namely, Python typically has 80 characters and 4 spaces instead of tabs.

Step Six

We need to tell the Python add-in where to find the systems Python Modules. This is usually in a folder such as /usr/share/python2.6. In the future, this step may be removed in favor of automatically detecting these directories.

Step Seven

If you need to configure any environment variables or command line arguments you can do so from the General options panel. Environment variables will be set before running your program within MonoDevelop. Any command line arguments will be passed as argv to your python project during runtime.

Step Eight

Profit! MonoDevelop will be doing an intensive scan of your Python Modules over the next few minutes while it indexes them. During that time code completion may be a bit slow. It depends on the speed of your hard disk. We hope to make this faster over time by being more intelligent in how we query.

If you would like syntax warnings you need to apt-get install pyflakes.