if it is in the sys.path
sys.path, what is this?
--
http://mail.python.org/mailman/listinfo/python-list
Byte wrote:
if it is in the sys.path
sys.path, what is this?
a variable in the sys module. quoting from a reply that you might have
missed:
$ python -c import sys; print sys.path
['', '/usr/lib/python24.zip', '/usr/lib/python2.4',
'/usr/lib/python2.4/plat-linux2',
/usr/lib/python2.4/site-packages ?
--
http://mail.python.org/mailman/listinfo/python-list
No, not there
-- /usr/bin/byte
--
http://mail.python.org/mailman/listinfo/python-list
Byte wrote:
Pretty much self explanatry, where are Python modules stored in Linux?
(i.e. in /usr/bin/local, or where?)
it depends on how and where Python is installed. to see where they
are on your install, use
$ python -c import sys; print sys.path
['', '/usr/lib/python24.zip',
Byte wrote:
Pretty much self explanatry, where are Python modules stored in Linux?
(i.e. in /usr/bin/local, or where?)
Depends on how you installed Python (or how your distro package system
installed it). But it's usually in $PREFIX/lib/pythonX.X , with $PREFIX
being one of /usr or /usr/local
[EMAIL PROTECTED]:~$ python
Python 2.4.2 (#2, Sep 30 2005, 21:19:01)
They are in one of the directories listed in sys.path, for me this is:
[GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2
Type help, copyright, credits or license for more information.
import sys
print sys.path
Byte wrote:
No, not there
Sure:
[EMAIL PROTECTED]:~$ ls /usr/lib/python2.4/site-packages
apt debconf.pyNumeric pygtk.py
README
apt_inst.so debconf.pyc Numeric.pth pygtk.pyc
setuptools-0.6a8-py2.4.egg
apt_pkg.so easy-install.pth
Found it in /usr/local/lib/python2.4/site-packages, thanks. Now, how do
i convert a .py program into a module?
-- /usr/bin/byte
--
http://mail.python.org/mailman/listinfo/python-list
Byte [EMAIL PROTECTED] wrote:
Found it in /usr/local/lib/python2.4/site-packages, thanks. Now, how do
i convert a .py program into a module?
a .py program is a module (the module's content is what's left when the
program is finished).
to make a useful module, just make sure that it defines
LOL
a .py program is a module, you can import it:
if it is in the sys.path (import modulename).
if it sits in a directory that is in the sys.path and the directory
also has a __init__.py file (import dirname.modulename / from dirname
import modulname).
if there is a modulename.pth file in the
Byte:
where are Python modules stored in Linux?
Where are eggs laid on the western hemisphere?
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
12 matches
Mail list logo