我有这个代码:它将一些俄罗斯符号写入csv文件:
def start_csv_writer(self, result_file_name):
scriptpath = os.path.dirname(__file__)
result_file_name = os.path.join(scriptpath, result_file_name)
open(result_file_name, 'w',encoding='utf8').close()
result = open(result_file_name, 'ab',encoding='utf8')
csv_writer = csv.writer(result, delimiter=';', quotechar='"',lineterminator='\n')
csv_writer.writerow(['запрос', '#', 'url', 'заголовок', 'сниппет' , 'brand_rate','snippet_rate', 'url_rate'])
csv_writer.writerow([ 'brand_names: ' + str(self.brand_names), 'additional_brand_words: ' + str(self.additional_brand_words), 'urls: ' + str(self.urls), 'keys: '+ str(self.keys)])
return csv_writer
当我尝试将cpde上传到pythonanywhere.com并将其托管在那里时BUT - 所有内容都会破坏,我会看到奇怪的符号: