[Tutor] printing all text that begins with "25"
Bo Morris
crushed26 at gmail.com
Thu Oct 2 17:41:49 CEST 2014
Hello all, hope everyone is doing well.
When I run the linux command "hamachi list" i get something along the lines
of the following output
087-888-279 Pandora 25.x.x.xxx alias: not
set
096-779-867 AM1LaptopBD-PC 25.x.x.xxx alias: not set
097-552-220 OWS-Desktop 1 25.0.0.0 alias: not set
099-213-641 DESKTOP 25.0.0.0 alias: not
set
I am trying to write a python script that will run the above command and
only print out the IP's that begin with 25. How do I strip out all other
text except for the IP's that begin with "25?"
Would it be best to send to a file first, then read the contents of the
file? Would I need to use regex? I know how to run the above command in
python. I also know how to send the output to a file and read the file;
however I cannot figure out how to strip all text out except for the IPs
that begin with "25."
Thanks
PS...Danny, still working on the "root" problem we discussed in previous
emails.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20141002/e16d9edb/attachment.html>
More information about the Tutor
mailing list