デバッグモードでエラーなくデバッグしたい
Yama286です
pythonプログラム作成し、runモードでは正常に動きますが、デバッグモードでは下記エラーとなります。
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe5 in position 1023: unexpected end of data
プログラムは下記です。プログラム名:src5-1-02.py
name = ['りんご' , 'みかん' , 'いちご' , 'メロン' , 'バナナ']
price = [150 , 100 , 400 , 600 , 180]
index = int(input('商品番号を入力:'))
if index < len(name) and index >= -len(name) :
print('{}:{}円'.format(name[index] , price[index]))
else :
print('番号が違います')
なお気になるのは上記エラーの上に
File "C:\Program Files\JetBrains\PyCharm Community Edition 2023.1.2\plugins\python-ce\helpers\pydev_pydevd_bundle\pydevd_comm.py", line 304, in _on_run
r = r.decode('utf-8')
という行があります。
このpydevd_comm.pyというものは私が作ったものではありません。
なお、プログラムの先頭に
#coading:utf-8
を入れても改善しません。
どうぞよろしくお願いいたします。

回答1件
あなたの回答
tips
プレビュー