do export statement in Python script

Simon Strobl Simon.Strobl at
Wed Oct 22 13:19:29 CEST 2008


a program of mine, which is supposed to be used in a project, uses
nltk. I want the other users to be able to use my program without
having to fiddle around with their environment. Therefore, I tried
this code:


import os

os.system("export NLTK_DATA=/opt/nltk/data/")

import nltk

This doesn't work, although running "export NLTK_DATA=/opt/nltk/data/"
on the command line before running the program works. Why?


More information about the Python-list mailing list