0
私はプログラミングにかなり新しいです。私はこのエラーメッセージを理解していません。file was loaded in the wrong encoding utf-8
またはそれは実際にはコード内のエラーメッセージではありませんが、私の新しい.txtファイルどこに私はすべての見つけたキーワードを書く。 .txtファイルは、別のプログラムでExcelにソートして後でAccessに送信する情報を使用してuppを4000+行に取得します。メッセージは何を意味し、それを修正する方法はありますか? anaconda36python - ファイルが間違ったエンコーディングで読み込まれましたutf-8
import glob
def LogFile(filename, tester):
data = []
with open(filename) as filesearch: # open search file
filesearch = filesearch.readlines() # read file
file = filename[37:]
for line in filesearch:
if tester in line: # extract "Create Time"
short = line[30:]
data.append(short) # store all found wors in array
print (file)
with open('Msg.txt', 'a') as handler: # create .txt file
for i in range(len(data)):
handler.write(f"{file}|{data[i]}")
# open with 'w' to "reset" the file.
with open('LogFile.txt', 'w') as file_handler:
pass
# ---------------------------------------------------------------------------------
for filename in glob.glob(r'C:\Users\Documents\Access\\GTX797\*.log'):
LogFile(filename, 'Sending Request: Tester')
どのIDEをお使いですか? –
テキストエディタに表示されるメッセージに関する質問をする場合は、使用しているテキストエディタを教えてください。 –
@AzatIbrakov im anacondaとpycharmを使用しています – fili