473,574 Members | 2,252 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.platfor m" 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 3385
If you have Pywin32 installed, you can use WMI to get all these details.
The WMI classes to look at are win32_networkad apter and
win32_operating system.
Roger

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

<mu*******@yaho o.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.platfor m" 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.platfor m" 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((your server,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
28323
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 Schmoe</a>. When this link is clicked, an email window appears in the clicker's email client where the To: field is jschmoe@abc.com. What I want to have...
5
1917
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: location.href = "link?query"; ( this is done in order to maintain certain state information
2
1594
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
3901
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 varname as string = 'one of my variable. It's part of the table name. Dim t1 as String = varname+ "0000"
4
3228
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 email for each record. The query has the name of the employee and the supervisor, the title of the work and so on. I want the employee and supervisor...
5
72344
by: Hooyoo | last post by:
Hi, here, How to get local machine name and IP address? Thanks.
7
4641
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 have the following
0
910
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, replace(replace(replace(replace(T1.NAME,char(10),''),char(13),''), char(9),''),char(44), '') as NAME,T1.LOC, case when...
1
5112
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
7720
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8044
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8096
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6451
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3739
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3749
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2240
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1337
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1056
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.