do export statement in Python script

James Mills prologic at shortcircuit.net.au
Wed Oct 22 13:24:44 CEST 2008


On Wed, Oct 22, 2008 at 9:19 PM, Simon Strobl <Simon.Strobl at gmail.com> wrote:
> #!/usr/bin/
> python
>
> import os
>
> os.system("export NLTK_DATA=/opt/nltk/data/")

Try:

os.environ["NLTK_DATA"] = "/opt/nltk/data/"

if that doesn't work, consider wrapping up NLTK
in a bash script that contains the shell statement:
export var=...

cheers
James

-- 
--
-- "Problems are solved by method"



More information about the Python-list mailing list