search

Home  >  Q&A  >  body text

struct - Python编写SNTP Client的一点疑问

天蓬老师天蓬老师2802 days ago891

reply all(1)I'll reply

  • 高洛峰

    高洛峰2017-04-18 09:42:20

    1. xhh is used to represent hexadecimal
      data='x1b'+47*'0' represents 48 bytes of data, the first byte is 0x1b, and the next 47 bytes are 0x00

    The direct printing result is: 'x1bx00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00 x00x00x00x00x00x00x00x00x00x00x00'

    1. is parsed into 12 ints in network byte order, and t is a tuple of 12 int elements

    reply
    0
  • Cancelreply