From db4fd993090090a7e7054bdfb4ccff667d4cf07b Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 13 Mar 2012 09:30:45 -0400 Subject: [PATCH] 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 ;). --- demo/python/cmd.py | 1 - demo/python/info.py | 1 - demo/python/mmap.py | 1 - swig/python/README.txt | 5 +++++ 4 files changed, 5 insertions(+), 3 deletions(-) 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 -- 2.26.2