質問するログイン新規登録

質問編集履歴

1

Fix format character

2016/05/20 16:19

投稿

ironGuy
ironGuy

スコア15

title CHANGED
File without changes
body CHANGED
@@ -2,7 +2,7 @@
2
2
  バイナリファイルからshort型(2bytes)を読み込もうとしています。
3
3
  0xb0 0x6aと書き込まれていて、45162が答えの時、
4
4
  ```
5
- answer = int(struct.unpack('H',pcap.read(2))[0])
5
+ answer = int(struct.unpack('h',pcap.read(2))[0])
6
6
  ```
7
7
  とすると27312になり、
8
8
  ```