I am a beginner in writing Python scripts and I need help on the following:
Threads::num,47141,47146,47151,47156,47161,47166,47171,47176
How can I get and display the last value '47176'
The following is the part of the code I have written:
elif sys.argv[1] == "-c": b = sys.argv[2] with open(b) as f: for line in f: if 'Threads::num' in line: print line.strip(',').split(',')[-1] print line
The output of this code is that it displays all the values as follows Threads::num,47141,47146,47151,47156,47161,47166,47171,47176
Please do help me
thx,
sid