473,396 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

query to find name of the OS, ip addr, mac addr etc

Hi all,

1) Am working on windows XP, and is there any way i can get the whole
name as "windows Xp" using python script?

i have tried with
"os.sys.platform" but it just gives me as "win32", but can
i get the whole OS name as "windows Xp".

If this is not possible, atleast i have a exe file, which puts all
the information about the system on the desktop, like os name, ip addr,
mac addr, etc etc, is there a way where i can collect this information
(from exe file to a text file ) with python script, so that atleast
that way i ll get the full OS name.

2) How can i get the "ip address" of my system? using python script.

3) How can i get the "mac address" of the system? using python script.

4) And how can i get the my "computer name" ? using python script.

Thanks in advance for having given a thought on my queries.

regards
yogi

Dec 14 '05 #1
2 3378
If you have Pywin32 installed, you can use WMI to get all these details.
The WMI classes to look at are win32_networkadapter and
win32_operatingsystem.
Roger

--
"Ask the ToeCutter - HE knows who I am !"

<mu*******@yahoo.com> wrote:
Hi all,

1) Am working on windows XP, and is there any way i can get the whole
name as "windows Xp" using python script?

i have tried with
"os.sys.platform" but it just gives me as "win32", but can
i get the whole OS name as "windows Xp".

If this is not possible, atleast i have a exe file, which puts all
the information about the system on the desktop, like os name, ip addr,
mac addr, etc etc, is there a way where i can collect this information
(from exe file to a text file ) with python script, so that atleast
that way i ll get the full OS name.

2) How can i get the "ip address" of my system? using python script.

3) How can i get the "mac address" of the system? using python script.

4) And how can i get the my "computer name" ? using python script.

Thanks in advance for having given a thought on my queries.

regards
yogi


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Dec 14 '05 #2

mu*******@yahoo.com wrote:
Hi all,

1) Am working on windows XP, and is there any way i can get the whole
name as "windows Xp" using python script?

i have tried with
"os.sys.platform" but it just gives me as "win32", but can
i get the whole OS name as "windows Xp".

If this is not possible, atleast i have a exe file, which puts all
the information about the system on the desktop, like os name, ip addr,
mac addr, etc etc, is there a way where i can collect this information
(from exe file to a text file ) with python script, so that atleast
that way i ll get the full OS name.

2) How can i get the "ip address" of my system? using python script.

3) How can i get the "mac address" of the system? using python script.

4) And how can i get the my "computer name" ? using python script.

Thanks in advance for having given a thought on my queries.

regards
yogi


win32 version, computer name: look in platform.system(), release,
win32_ver and uname

mac addr: if it's avail, it's in WMI:
http://tgolden.sc.sabren.com/python/wmi.html

ip:
import socket; s=socket.socket()
s.connect((yourserver,yourport))
s.getsockname()

Dec 14 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Shinin | last post by:
I am trying to set up a mailto: link so that the actual address that the email is being sent to is obscured and replaced by a name. For example, I have <a href="mailto:jschmoe@abc.com">Joe...
5
by: ~greg | last post by:
I have links on an index page like this: <a href="link" onclick="DoOnClick('link')"> page title </a> -where the DoOnClick("link") just adds a query part to the url before executing: ...
2
by: Weiping He | last post by:
suppose I've got two table: laser_uni=# \d t1 Table "public.t1" Column | Type | Modifiers --------+------+----------- name | text | addr | text | laser_uni=# \d t2
28
by: Arial | last post by:
My SQL string is kind of wierd one. In my application, I need to select things from an unknown name table. But I know the table name before the SQL command is executed. For instance, Dim...
4
by: douglaswade | last post by:
I am new to Access, but I find this answer a little difficult to understand. I have an access query that list late work, I want to run the query and let say the results is ten records. I want one...
5
by: Hooyoo | last post by:
Hi, here, How to get local machine name and IP address? Thanks.
7
by: Steve Rainbird | last post by:
I am getting a precompiler error which I don't understand. In my Cobol program I have the following code 01 TESTDB. 03 ADDR. EXEC SQL INCLUDE 'ADDR.cop' END-EXEC. In the ADDR.cop file I...
0
by: RajTS | last post by:
I need to convert the address field data in to 3 parts(ADDR1, ADDR2, ADDR3), currently the address field is split into 2 parts. (ADDR1 and ADDR2) code: (select T1.ROW_ID,T1.CUST_STAT_CD, ...
1
by: MLH | last post by:
Have UNION query pulling & merging data from 3 tables. Would like to show Name, Addr, City, State, Zip and table name of source table. Dunno how.
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.