plateform info.

M

Monu Agrawal

Hi I want to know whether the program is being run on windows or on
Xnix. Is there any variable or method which tells me that it's windows?
 
J

Juho Schultz

Monu said:
Hi I want to know whether the program is being run on windows or on
Xnix. Is there any variable or method which tells me that it's windows?

os.name - the value is "posix" for Linux/Unix, "nt" or "ce" for Windows,
and so on...
 
M

Mikael Olofsson

Monu said:
Hi I want to know whether the program is being run on windows or on
Xnix. Is there any variable or method which tells me that it's windows?

Will this help?
'win32'

There is also the platform module, that can give you a lot more
information about the your platform. Try help(platform).

/MiO
 
M

Maurice LING

Mikael said:
Will this help?

'win32'

There is also the platform module, that can give you a lot more
information about the your platform. Try help(platform).

/MiO

Adding onto this (which may be of need), but if this seems to be a
hijack, my apologies......

Is there a way of getting the path to the site-packages directory?
Considering that Mac OSX with Fink installs python libraries in
/sw/lib/python<version>, Mac OSX itself has python libraries in
/System/Library/Frameworks/Python.framework/Versions/<version>/lib, etc
etc...

maurice
 
M

Maurice LING

Mikael said:
Will this help?

'win32'

There is also the platform module, that can give you a lot more
information about the your platform. Try help(platform).

/MiO

Adding onto this (which may be of need), but if this seems to be a
hijack, my apologies......

Is there a way of getting the path to the site-packages directory?
Considering that Mac OSX with Fink installs python libraries in
/sw/lib/python<version>, Mac OSX itself has python libraries in
/System/Library/Frameworks/Python.framework/Versions/<version>/lib, etc
etc...

maurice
 
M

Mike Meyer

Maurice LING said:
Is there a way of getting the path to the site-packages directory?
.... if os.path.split(dir)[-1] == 'site-packages':
.... print dir
....
/usr/opt/lib/python2.4/site-packages
But there's seldom a reason to want this.
Considering that Mac OSX with Fink installs python libraries in
/sw/lib/python<version>, Mac OSX itself has python libraries in
/System/Library/Frameworks/Python.framework/Versions/<version>/lib, etc
etc...

And darwinportgs puts them in
/Library/Frameworks/Python.framework/Versions/<Version>/lib/...
but includes /opt/local/lib/python2.4/site-packages in sys.path.

<mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top