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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • open raz
    New Member
    • Nov 2010
    • 1

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

    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.
  • Gonzalo Gonza
    New Member
    • Nov 2010
    • 16

    #2
    I think that you can embed a piece of batch, that would be netstat -a

    The code will be something like this:
    Code:
    from os import system
    os.system('netstat -a')
    
    #And if you want to write it in a txt you can do:
    s=open('hellothere.txt', 'w')
    s.write(os.system('netstat -a'))
    s.close()

    Comment

    Working...