0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

windowsでpythonを扱うときに気を付けたこと

Last updated at Posted at 2019-08-29

今後会社などでpythonを扱いたくなった時のためのメモです

結論 visual studioを使うとよい

他には

cp932' codec can't decode byte 0x8e in position 18: illegal multibyte sequenceが出るとき

以下のコードを先頭に書く


import io, sys
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,
encoding=sys.stdout.encoding, 
errors='backslashreplace', 
line_buffering=sys.stdout.line_buffering)


さらに

ファイルを扱うopenファイルでunicodeエラーが起きた時

        with open(path) as f:

こんな感じのを

        with open(path, encoding="utf-8") as f:

に変える

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?