From: W. Trevor King Date: Tue, 13 Mar 2012 13:30:45 +0000 (-0400) Subject: Suggest people use `PYTHONPATH` rather than adjusting `sys.path` internally. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=db4fd993090090a7e7054bdfb4ccff667d4cf07b;p=comedilib.git Suggest people use `PYTHONPATH` rather than adjusting `sys.path` internally. The old method only worked out of the box if you were running Python 2.1 on a 586. I imagine that is too small a slice of current users to be worth hard coding ;). --- diff --git a/demo/python/cmd.py b/demo/python/cmd.py index 83b5f5d..2ae90dd 100755 --- a/demo/python/cmd.py +++ b/demo/python/cmd.py @@ -17,7 +17,6 @@ #set the paths so python can find the comedi module import sys, os, string, struct, time -sys.path.append('./build/lib.linux-i586-2.1') import comedi as c diff --git a/demo/python/info.py b/demo/python/info.py index e53d554..9845985 100755 --- a/demo/python/info.py +++ b/demo/python/info.py @@ -16,7 +16,6 @@ #set the paths so python can find the comedi module import sys, os, string -sys.path.append('./build/lib.linux-i586-2.1') import comedi as c diff --git a/demo/python/mmap.py b/demo/python/mmap.py index 5803308..65f9f82 100755 --- a/demo/python/mmap.py +++ b/demo/python/mmap.py @@ -24,7 +24,6 @@ import sys, os, string, struct, time, array sys.path.append(sys.path.pop(0)) import mmap -sys.path.append('./build/lib.linux-i586-2.1') import comedi as c #open a comedi device diff --git a/swig/python/README.txt b/swig/python/README.txt index 84654a4..3cca5d3 100644 --- a/swig/python/README.txt +++ b/swig/python/README.txt @@ -18,6 +18,11 @@ $ python setup.py build $ python setup.py install + If you want to test the wrappers before installing them, you will + need to set the `PYTHONPATH` environment variable so Python can find + the compiled modules. On my system, that looks like + $ PYTHONPATH=build/lib.linux-i686-2.7/ ../../demo/python/info.py + 2) Using the module All the comedilib functions are translated directly to python function. The various comedi structs are now available as python