Hi,
there are a lot of snippets on how to do this, I probably tried 90% of them by now but nothing is working.
I started writing in Python, I never thought such a simple thing like a calling other script would be that complicated, what a pile of crap this Python is.
Any way, is anybody has a code I can use?
Thank you.
Here is a code and at the bottom of the code is a "perl call" that does not work.
[sub]import os
import socket
import sys
pfile = open('C:/Scripts/CMV_Hosts_Verification/Lists/IP_Active.txt')
h_active = open("C:/Scripts/CMV_Hosts_Verification/Lists/CMV_Active_Hosts_List.txt","w")
sys.stdout = h_active
while True:
IP = pfile.readline()
try:
host = socket.gethostbyaddr(IP.rstrip())
print(IP,host)
print (IP,file=h_active)
except EOFError:
print('Why did you do an EOF on me?',file=h_active)
pflie.close()
h_active.close()
var = "C:/Scripts/CMV_Hosts_Verification/"
pipe = subprocess.Popen(["perl", "Clean_Host_Names_CMV.pl"])
subprocess.call(["C:/Strawberry/perl/bin/.perl.exe", "C:/Scripts/CMV_Hosts_Verification/Clean_Host_Names_CMV.pl", var])
[/sub]
there are a lot of snippets on how to do this, I probably tried 90% of them by now but nothing is working.
I started writing in Python, I never thought such a simple thing like a calling other script would be that complicated, what a pile of crap this Python is.
Any way, is anybody has a code I can use?
Thank you.
Here is a code and at the bottom of the code is a "perl call" that does not work.
[sub]import os
import socket
import sys
pfile = open('C:/Scripts/CMV_Hosts_Verification/Lists/IP_Active.txt')
h_active = open("C:/Scripts/CMV_Hosts_Verification/Lists/CMV_Active_Hosts_List.txt","w")
sys.stdout = h_active
while True:
IP = pfile.readline()
try:
host = socket.gethostbyaddr(IP.rstrip())
print(IP,host)
print (IP,file=h_active)
except EOFError:
print('Why did you do an EOF on me?',file=h_active)
pflie.close()
h_active.close()
var = "C:/Scripts/CMV_Hosts_Verification/"
pipe = subprocess.Popen(["perl", "Clean_Host_Names_CMV.pl"])
subprocess.call(["C:/Strawberry/perl/bin/.perl.exe", "C:/Scripts/CMV_Hosts_Verification/Clean_Host_Names_CMV.pl", var])
[/sub]