tgtPorts = str(options.tgtPort).split(', ')
I'm trying to split a string tgtPort
that could look like 21, 80, 139
According to the website I was looking at, the above should split that string into a list containing each individual element IE: 139
However using:
for tgtPort in tgtPorts:
print tgtPort + "\n"
I find that my list only contains 21,
How can I ensure that the comma and the space are removed?
How can I ensure that all elements will end up in my list and not just the first one?