Currently, I have to change 21 of those txt files to 2, what should I do with Python? I think it's going to work, but I'm struggling because it's not working. Please let me know.
python
textname = ''
with open(f'{textname}.txt', 'r') as txt:
a = txt.read()
a = a.replace('21 ', '2 ')
with open(f'{textname}.txt', 'w+') as txt:
txt.write(a)
© 2024 OneMinuteCode. All rights reserved.