Cognitive Mileage

How to Use Python 2.5 Modules in Iron Python Studio

Posted on: May 13, 2008

This was recently a problem for me when I wanted to use Python 2.5’s string Templates and random number generation with Iron Python Studio but couldn’t. Here’s how you enable the libraries in Iron Python Studio (IPS):

1. Install the version of Python (CPython) you want to use.
2. Direct IPS to the Python directory you are using by inserting the following lines into the beginning of the .py file you wish to use the modules in:

import sys
sys.path.append("C:\\Python25\\Lib")

For your own work, just change “”C:\\Python25\\Lib” to point to the Lib folder of whatever version of Python (in whatever location) you want to use.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: