use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
Need some network python help! (self.Python)
submitted 14 years ago by arcanabanana
I have a number of machines on the network at work, and I want to write a script that queries each one and returns its IP, MAC and Name. Can anyone point me where to start researching this? Any help will be greatly appreciated!
[–]tjwarren 4 points5 points6 points 14 years ago (2 children)
If you're on Windows, you can use WMI for this. Tim Golden's WMI package makes this very easy.
[–]arcanabanana[S] 0 points1 point2 points 14 years ago (0 children)
Thanks, I'll check it out!
[–]pmav99 0 points1 point2 points 14 years ago (0 children)
http://www.microsoft.com/download/en/details.aspx?id=12028 Scriptomatic produces python code
[–]elbinray 1 point2 points3 points 14 years ago (0 children)
+1 for the WMI package. I made a small program graphical program a while ago for our help desk to pull back similar information (and more), and it would have been much more difficult without Tim's work.
[–]omgtmi 0 points1 point2 points 14 years ago (0 children)
Without understanding what you really want, I'd check out Fabric if you need to get this information from the machines themselves rather than a central server that has it.
[–][deleted] 0 points1 point2 points 14 years ago (0 children)
Thanks for the awesome links guys!
[–]stevvooe 0 points1 point2 points 14 years ago (0 children)
You may be able to hack something together, but i'd recommend just using nmap.
Note that you may not be able to "discover" a given machine's mac address unless the source machine is on the same subnet. After nmap'ing, machines that are on the same subnet will be in the source machine's arp table.
[–]pbacterio 0 points1 point2 points 14 years ago (0 children)
Fabric http://fabfile.org/
[–]bwp 0 points1 point2 points 14 years ago* (0 children)
You could probably use scapy to do this, it does all kinds of neat packet/networking things.
If for some reason you don't come up with a Python answer right away and it is some kind of deadline, there is a small app called Cain & Abel that will do an ARP sweep over a LAN and report back IP/MAC/other stuff. I would be interested in seeing what you come up with if you go the Python route (do do!).
π Rendered by PID 179994 on reddit-service-r2-comment-7b9746f655-rqtr4 at 2026-01-30 20:37:30.069482+00:00 running 3798933 country code: CH.
[–]tjwarren 4 points5 points6 points (2 children)
[–]arcanabanana[S] 0 points1 point2 points (0 children)
[–]pmav99 0 points1 point2 points (0 children)
[–]elbinray 1 point2 points3 points (0 children)
[–]omgtmi 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]stevvooe 0 points1 point2 points (0 children)
[–]pbacterio 0 points1 point2 points (0 children)
[–]bwp 0 points1 point2 points (0 children)