Monday, April 19, 2010

Include additional library in some local directory in Python

#! /usr/bin/python

# MyProgram.py

# import sys module
import sys

# the relative path to this script "MyProgram.py" where you place your library (ex.  ../MySQL/MySQLWrapper.py )
sys.path.append('../MySQL/')

# import the library
from MySQLWrapper import MySQLWrapper

0 comments: