I'm having a hard time trying to use .strip with the following line of code.
Thanks for the help.
f.write(re.split("Tech ID:|Name:|Account #:",line)[-1])
You can use the strip() to remove trailing and leading spaces.
>>> s = ' abd cde ' >>> s.strip() 'abd cde'
Note: the internal spaces are preserved
1.4m articles
1.4m replys
5 comments
57.0k users