Getting information from OS

S

Skulled2003

Hi,

I have a question on getting information from the os to be used in one of my programs.

What i need to accomplish is a list of languages that are installed or can be viewed on the system. I am not sure if i am making it clear, but the list should contain information on the languages that a system can recognize and use in applications etc.

Any help would be greatly appreciated.

Thanks,

Vinod

__________________________________________________________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need.

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp
 
C

Christopher T King

What i need to accomplish is a list of languages that are installed
or can be viewed on the system. I am not sure if i am making it clear,
but the list should contain information on the languages that a system
can recognize and use in applications etc.

Is this on Unix or Windows? On Unix, something like the following would
work:

-----

import os
from os.path import join
from glob import glob

binpath = os.environ['PATH'].split(':')

def installed(bins):
for bin in bins:
for path in binpath:
if glob(join(path,bin)):
return True

progs = {
'Python':['python','python2.?'],
'Perl':['perl','perl5.?.?'],
'Java':['java','javac','gcj'],
'C':['cc','gcc','bcc','icc']
}

installed_progs = [prog for prog,bins in progs.items() if installed(bins)]

for prog in installed_progs:
print prog,'is installed!'
 
C

Cameron Laird

Hi,

I have a question on getting information from the os to be used in
one of my programs.

What i need to accomplish is a list of languages that are installed
or can be viewed on the system. I am not sure if i am making it clear,
but the list should contain information on the languages that a system
can recognize and use in applications etc.
.
.
.
Important as your question is, conventional computing practice
is ill-equipped to answer it coherently. You'll do best to
specify your situation more fully: is it Win*, including even
Win95, that interests you? Are you building "console applica-
tions" with Python, or do you have a particular GUI toolkit in
mind?
 

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

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top