#敏感词过滤器
def text_creat(name,msg):
desktop_path = 'C:/Users/lenovo/Desktop/';
full_path = desktop_path + name + '.txt';
file = open(full_path,'w');
file.write(msg);
file.close();
print('Done');
def text_filter(word, censored_word='lame', changed_word='Awesome'):
return word.replace(censored_word, changed_word);
def wenben_filter(name,msg):
clean_msg=text_filter(msg);
text_creat(name,clean_msg);
wenben_filter('hello','python is lame lame !!!');