- センター試験: 数学IIBのプログラムについて語るスレ part3
115 :デフォルトの名無しさん[]:2015/09/06(日) 04:44:09.92 ID:2A7JkPdq - 3355411
| - Pythonのお勉強 Part50
904 :デフォルトの名無しさん[sage]:2015/09/06(日) 08:04:46.13 ID:2A7JkPdq - なにが?
| - くだすれPython(超初心者用) その27©2ch.net
13 :デフォルトの名無しさん[sage]:2015/09/06(日) 09:22:56.63 ID:2A7JkPdq - >>> import struct
>>> a='\x01\x02\x03\x04\x05\x06\x07\x08' >>> a '\x01\x02\x03\x04\x05\x06\x07\x08' >>> struct.unpack('8c', a) ('\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08') >>> struct.unpack('2i', a) (67305985, 134678021) >>> struct.unpack('i4c', a) (67305985, '\x05', '\x06', '\x07', '\x08') >>> map(hex, struct.unpack('2i', a)) ['0x4030201', '0x8070605']
| - くだすれPython(超初心者用) その27©2ch.net
14 :デフォルトの名無しさん[sage]:2015/09/06(日) 09:32:31.32 ID:2A7JkPdq - >>> map(hex, struct.unpack('4h', '\x01\x02\x03\x04\x05\x06\x07\x08'))
['0x201', '0x403', '0x605', '0x807'] >>> map(hex, struct.unpack('i2h', '\x01\x02\x03\x04\x05\x06\x07\x08')) ['0x4030201', '0x605', '0x807'] >>> map(hex, struct.unpack('hhhh', '\x01\x02\x03\x04\x05\x06\x07\x08')) ['0x201', '0x403', '0x605', '0x807'] >>> map(hex, struct.unpack('hih', '\x01\x02\x03\x04\x05\x06\x07\x08')) struct.error: unpack requires a string argument of length 10 >>> map(hex, struct.unpack('hih', '\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a')) ['0x201', '0x8070605', '0xa09']
| - Visual Studio 2015 SP2©2ch.net
710 :デフォルトの名無しさん[sage]:2015/09/06(日) 09:35:02.46 ID:2A7JkPdq - ブラクラだな
|
|