By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,089 Members | 2,260 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,089 IT Pros & Developers. It's quick & easy.

How to list the ip address of the computers connected to my computer

P: 1
Hi all,

I am a python newbie. I am trying to query the network to see the ip address of the computers connected to my computer. I googled a lot but I could not find some simple methods for solving it.
Any simple sample scripts and advices will be of great help to me to learn python.

Thanking you.
Nov 8 '10 #1
Share this Question
Share on Google+
1 Reply


P: 16
I think that you can embed a piece of batch, that would be netstat -a

The code will be something like this:
Expand|Select|Wrap|Line Numbers
  1. from os import system
  2. os.system('netstat -a')
  3.  
  4. #And if you want to write it in a txt you can do:
  5. s=open('hellothere.txt', 'w')
  6. s.write(os.system('netstat -a'))
  7. s.close()
Nov 16 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.