def text_filter(msg,censored_word = 'lame',changed_word = 'Awesome'):
return msg.replace(censored_word,changed_word)
def text_consored_creat(name,msg):
desk_top_path = 'E:/Users/'
full_path = desk_top_path +name+'.txt'
file=open(full_path,'w')
def text_filter(msg, censored_word='lame', changed_word='Awesome'):
return msg.replace(censored_word, changed_word)
file.write(str(text_filter(msg)))
file.close()
print('DONE')
print(text_consored_creat('wy','Python is lame'))
文本过滤器
最新推荐文章于 2022-12-16 19:31:45 发布