回答編集履歴

1

Update

2022/01/17 09:51

投稿

melian
melian

スコア19840

test CHANGED
@@ -1,7 +1,7 @@
1
1
  数値の意味が変化しないのであれば、`decode()` の際に `errors='ignore'` を付けてみるとよいかもしれません()。
2
2
  ```python
3
- >>> r
3
+ >>> data
4
4
  b'16\xb5.06\r\n'
5
- >>> r.rstrip().decode("utf-8", errors='ignore')
5
+ >>> float(data.rstrip().decode("utf-8", errors='ignore'))
6
- '16.06'
6
+ 16.06
7
7
  ```