i would like to fetch only the lines from windows net use cmd wich are relevant for me.
if UNC path is to long net use does a line break
my code:
output = subprocess.Popen('net use', stdout=subprocess.PIPE).communicate()
valid_lines = [ line.strip() for line in output[0].split('\r\n')]
valid_lines = valid_lines[6:-3]
print "output", valid_lines
Sample net use:
output ['Getrennt \\192.168.1.111\bze\export', 'Microsoft Windows Network', 'OK \\master\bze\export Microsoft Windows Network']
i would like to have the output in from first one line, like on 'OK.....'
thx