Movatterモバイル変換


[0]ホーム

URL:


linux & users' python-extensions

Alex Martellialeaxit at yahoo.com
Mon Apr 9 15:06:14 EDT 2001


"Pawe³ Sto³owski" <pawelstol at poczta.onet.pl> wrote in messagenews:slrn.pl.9d3u29.e3p.pawelstol at localhost.localdomain...> I've installed Python into /usr/local/bin and /usr/local/lib/Python2.0.> Now I'd like to allow an ordinary user to maintain his ownpython-extensions> modules (written in C/C++). So, each user's python programs should see> the global modules hierarchy, but also allow the user to import his own> modules and link coresponding C/C++ modules, when needed. Is it possible> without cluttering global Python-configuration each time an user needs> to play with his new extension-module? I'm new to Python, so any help> will be appreciated; I found lots of docs on the web, but I can't find> the exact answer to the above question (if it exists at all).There are many approaches, but the simplest one may be to noticethat each user can freely set his or her own preferred value for theenvironment variable PYTHONPATH, and its contents (parsed from acolon-separated string, into a list of strings) will be prepended to theinitial value of sys.path upon entry to Python scripts.  Each user cando it at will in his or her own starting shell scripts, or otherwise, sothe hassle for the administrator should be minimal.Alex


More information about the Python-listmailing list

[8]ページ先頭

©2009-2025 Movatter.jp