Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-21 Thread pythonewbie
On 21 jan, 05:31, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Sun, 20 Jan 2008 13:58:13 -0800 (PST), pythonewbie [EMAIL PROTECTED] declaimed the following in comp.lang.python: I just would like to know if I would ALWAYS find the install directory in sys.path[6] and site-packages directory

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-21 Thread pythonewbie
On 21 jan, 09:53, pythonewbie [EMAIL PROTECTED] wrote: On 21 jan, 05:31, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Sun, 20 Jan 2008 13:58:13 -0800 (PST), pythonewbie [EMAIL PROTECTED] declaimed the following in comp.lang.python: I just would like to know if I would ALWAYS find the

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-21 Thread John Machin
On Jan 21, 8:12 pm, pythonewbie [EMAIL PROTECTED] wrote: On 21 jan, 09:53, pythonewbie [EMAIL PROTECTED] wrote: On 21 jan, 05:31, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Sun, 20 Jan 2008 13:58:13 -0800 (PST), pythonewbie [EMAIL PROTECTED] declaimed the following in

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-21 Thread Diez B. Roggisch
pythonewbie Because the solution using distutils.sysconfig.get_python_lib() is very smart ! Depending on your goal. You said My goal is to verify if an/several extension(s) are installed and to automatically install the missing ones on Linux or Win32. This goal can't be reached with

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-21 Thread pythonewbie
On 21 jan, 10:34, Diez B. Roggisch [EMAIL PROTECTED] wrote: pythonewbie Because the solution using distutils.sysconfig.get_python_lib() is very smart ! Depending on your goal. You said My goal is to verify if an/several extension(s) are installed and to automatically install the

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-21 Thread pythonewbie
On 21 jan, 10:34, Diez B. Roggisch [EMAIL PROTECTED] wrote: pythonewbie Because the solution using distutils.sysconfig.get_python_lib() is very smart ! Depending on your goal. You said My goal is to verify if an/several extension(s) are installed and to automatically install the

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-21 Thread John Machin
On Jan 21, 9:05 pm, pythonewbie [EMAIL PROTECTED] wrote: On 21 jan, 10:34, Diez B. Roggisch [EMAIL PROTECTED] wrote: [snip] Diez To John Machin, Get a clue #1: read the instructions for your news client ... like the bit that says click on the message/posting that you want to reply to

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-21 Thread Diez B. Roggisch
Diez, I repeat I am a newbie, so please don't be angry against me, if I say something stupid or if I propose a method not efficient. Where did I sound angry? An easy way to get the absolute path of site-packages seems very useful to me, in order to check anything (all extensions

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-21 Thread pythonewbie
On 21 jan, 11:49, Diez B. Roggisch [EMAIL PROTECTED] wrote: Diez, I repeat I am a newbie, so please don't be angry against me, if I say something stupid or if I propose a method not efficient. Where did I sound angry? An easy way to get the absolute path of site-packages seems very

Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread pythonewbie
Hi all, I am newbie in Python, my wish would be to create python applications for both Linux/Win32. I am stucked on creating a function to get the Python install directory (and site-packages directory) with a 100% reliable method... My goal is to verify if an/several extension(s) are installed

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread Christian Heimes
pythonewbie wrote: I am stucked on creating a function to get the Python install directory (and site-packages directory) with a 100% reliable method... Only one method is 100% reliable: try: import yourextension except ImportError: available = False else: available = True

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread pythonewbie
On 20 jan, 12:20, Christian Heimes [EMAIL PROTECTED] wrote: pythonewbie wrote: I am stucked on creating a function to get the Python install directory (and site-packages directory) with a 100% reliable method... Only one method is 100% reliable: try: import yourextension except

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread Diez B. Roggisch
pythonewbie schrieb: On 20 jan, 12:20, Christian Heimes [EMAIL PROTECTED] wrote: pythonewbie wrote: I am stucked on creating a function to get the Python install directory (and site-packages directory) with a 100% reliable method... Only one method is 100% reliable: try: import

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread Michael L Torrie
pythonewbie wrote: Hi all, I am newbie in Python, my wish would be to create python applications for both Linux/Win32. I am stucked on creating a function to get the Python install directory (and site-packages directory) with a 100% reliable method... My goal is to verify if an/several

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread pythonewbie
On 20 jan, 19:50, Diez B. Roggisch [EMAIL PROTECTED] wrote: pythonewbie schrieb: On 20 jan, 12:20, Christian Heimes [EMAIL PROTECTED] wrote: pythonewbie wrote: I am stucked on creating a function to get the Python install directory (and site-packages directory) with a 100% reliable

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread Diez B. Roggisch
pythonewbie schrieb: On 20 jan, 19:50, Diez B. Roggisch [EMAIL PROTECTED] wrote: pythonewbie schrieb: On 20 jan, 12:20, Christian Heimes [EMAIL PROTECTED] wrote: pythonewbie wrote: I am stucked on creating a function to get the Python install directory (and site-packages directory) with a

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread Martin v. Löwis
But for different reasons I also want to get the absolute path of Python install directory (not only the executable under Linux) and site-packages directory. The Python install directory is available as sys.prefix. The site-packages directory is sys.prefix+lib/python+x.y+/site-packages (where

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread pythonewbie
On 20 jan, 20:59, Diez B. Roggisch [EMAIL PROTECTED] wrote: pythonewbie schrieb: On 20 jan, 19:50, Diez B. Roggisch [EMAIL PROTECTED] wrote: pythonewbie schrieb: On 20 jan, 12:20, Christian Heimes [EMAIL PROTECTED] wrote: pythonewbie wrote: I am stucked on creating a function to get

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread pythonewbie
On 20 jan, 23:19, Martin v. Löwis [EMAIL PROTECTED] wrote: But for different reasons I also want to get the absolute path of Python install directory (not only the executable under Linux) and site-packages directory. The Python install directory is available as sys.prefix. The

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread John Machin
On Jan 21, 8:58 am, pythonewbie [EMAIL PROTECTED] wrote: I just would like to know if I would ALWAYS find the install directory in sys.path[6] and site-packages directory in sys.path[7] on any Win32 platform and sys.path[2] and site-packages directory in sys.path[6] on any Linux platform. If

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread pythonewbie
On 20 jan, 23:55, Diez B. Roggisch [EMAIL PROTECTED] wrote: pythonewbie schrieb: On 20 jan, 20:59, Diez B. Roggisch [EMAIL PROTECTED] wrote: pythonewbie schrieb: On 20 jan, 19:50, Diez B. Roggisch [EMAIL PROTECTED] wrote: pythonewbie schrieb: On 20 jan, 12:20, Christian Heimes

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread Diez B. Roggisch
pythonewbie schrieb: On 20 jan, 20:59, Diez B. Roggisch [EMAIL PROTECTED] wrote: pythonewbie schrieb: On 20 jan, 19:50, Diez B. Roggisch [EMAIL PROTECTED] wrote: pythonewbie schrieb: On 20 jan, 12:20, Christian Heimes [EMAIL PROTECTED] wrote: pythonewbie wrote: I am stucked on creating a

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread John Machin
On Jan 21, 11:00 am, pythonewbie [EMAIL PROTECTED] wrote: On 21 jan, 00:09, John Machin [EMAIL PROTECTED] wrote: On Jan 21, 8:58 am, pythonewbie [EMAIL PROTECTED] wrote: I just would like to know if I would ALWAYS find the install directory in sys.path[6] and site-packages directory

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread pythonewbie
On 21 jan, 00:09, John Machin [EMAIL PROTECTED] wrote: On Jan 21, 8:58 am, pythonewbie [EMAIL PROTECTED] wrote: I just would like to know if I would ALWAYS find the install directory in sys.path[6] and site-packages directory in sys.path[7] on any Win32 platform and sys.path[2] and