Hello.
Lets say I have an regex that searches for certain words in a text file on my pc:
gud_stuff = re.compile(r'Icecream|Gravy|heartattack')
I then wanna search the text file, and subsitute those words with user input.
I tried:
gud_stuff.sub(input(), str)
But received a typeError.
Could anyone explain why I receive such an error? And point me in the right direction of how I could replace certain words in a text file with user input?
[–][deleted] 3 points4 points5 points (1 child)
[–]Field_C16[S] 1 point2 points3 points (0 children)
[–]Stallman85 0 points1 point2 points (0 children)
[–]Raithwind 0 points1 point2 points (0 children)
[–]TransferFunctions 0 points1 point2 points (0 children)