Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > RE: Get OS name

Reply
Thread Tools

RE: Get OS name

 
 
Tim Golden
Guest
Posts: n/a
 
      04-15-2005
[rbt]
|
| codecraig wrote:
| > How can I get the OS Name, such as "Windows XP Pro". I
| know I can do
| >
| > sys.getwindowsversion but that doesnt return a nice Windows XP Pro
| > string.
| >
| > and os.name gives "nt"
| >
| > thanks.
| >
|
| Read the docs... sys.getwindowsversion() should do the trick. AFAIK,
| there is no way to differentiate between XP Home and Pro...

I'm no expert on this (I don't even use XP) but the WMI
Win32_OperatingSystem class seems to give a useful string
here:

<code>
import wmi

c = wmi.WMI ()
for os in c.Win32_OperatingSystem ():
print os.Caption

</code>

gives "Microsoft Windows XP Professional" and
"Microsoft Windows 2000 Professional" on a couple
of machines I tried.

TJG

__________________________________________________ ______________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
__________________________________________________ ______________________
 
Reply With Quote
 
 
 
 
codecraig
Guest
Posts: n/a
 
      04-15-2005
where can I get wmi module, it doesnt come with Python right?

thanks.

 
Reply With Quote
 
 
 
 
Grant Edwards
Guest
Posts: n/a
 
      04-15-2005
On 2005-04-15, codecraig <(E-Mail Removed)> wrote:

> where can I get wmi module, it doesnt come with Python right?


http://www.google.com/search?q=python+wmi+module

--
Grant Edwards grante Yow! ... I want a COLOR
at T.V. and a VIBRATING BED!!!
visi.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
adding a variable name to a hash to name is part of the variable name Bobby Chamness Perl 2 04-22-2007 09:54 PM
print("my name is {name}, and {age}-year old {gender}", name, age, gender); =?iso-8859-1?B?bW9vcJk=?= Java 7 01-02-2006 04:39 PM
IE name="name" & form.name property bug Java script Dude Javascript 5 06-30-2004 03:07 AM
name = name.substring(0, name.lastIndexOf('.')); Help please Jack-2 Javascript 3 12-24-2003 04:39 PM
Re: Urgent! how to get object name, method name and attribute name based on the strings? ding feng C++ 2 06-25-2003 01:18 PM



Advertisments