Subprocess module errors with 'export' in python on linux?

Viewed 8868

I'm setting up a program to connect my computer to our schools proxy and currently have something like this:

import subprocess
import sys

username = 'fergus.barker'
password = '*************'
proxy = 'proxy.det.nsw.edu.au:8080'
options = '%s:%s@%s' % (username, password, proxy)

subprocess.Popen('export http_proxy=' + options)

But upon running I get:

Traceback (most recent call last):
File "school_proxy_settings.py", line 19, in <module>
 subprocess.Popen('export http_proxy=' + options)
File "/usr/lib/python2.6/subprocess.py", line 621, in __init__
 errread, errwrite)
File "/usr/lib/python2.6/subprocess.py", line 1126, in _execute_child
 raise child_exception
OSError: [Errno 2] No such file or directory

Why is this happening please guys?

2 Answers
Related