By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,842 Members | 2,148 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,842 IT Pros & Developers. It's quick & easy.

this code replace text in a uni-code file

P: 1
This works, but I'd like to know peoples opinions.

with open ("readme.txt","r") as file:
fl[:] = [s.replace('xxxx', '.....') for s in fl]
with open("readme.txt","w") as file:

Dec 18 '18 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.