Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8486839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:04:13+00:00 2026-06-10T21:04:13+00:00

when i change number into hex in struct module of python, >>> import struct

  • 0

when i change number into hex in struct module of python,

>>> import struct
>>> struct.pack("i",89)
'Y\x00\x00\x00'
>>> struct.pack("i",890)
'z\x03\x00\x00'
>>> struct.pack("i",1890)
'b\x07\x00\x00'

what is the meaning of “Y,z,b” in the output?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T21:04:14+00:00Added an answer on June 10, 2026 at 9:04 pm

    You’re not converting to hex. You’re packing the integer as binary data… in this case, little-endian binary data. The first characters are just the corresponding ASCII characters to the raw bytes; e.g. 89 is Y, 122 is z, and 98 is b.

    • The first pack produces '\x59\x00\x00\x00' for 0x00000059; '\x59' is 'Y'.
    • The second produces '\x7a\x03\x00\x00' for 0x0000037a; '\x7a' is 'z'.
    • The third produces '\x62\x07\x00\x00' for 0x00000762; '\x62' is 'b'.

    See the below ASCII table.


    (source: asciitable.com)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can replace arabic number with latin number as that doesn't change number into
I have a need to import a number of CSV files into corresponding tables
I would like to change number (ie. 19455) into something shorter using numbers and
I want to change a number to a string like this: var i =
I want to change the number of tableviews depending on my input, which will
Possible Duplicate: How to change the number of rows in the textarea using jQuery
Is there any performance difference in my application if I change the number of
I have a number input that should trigger jQuery on every change. To do
im trying to make input that automaticaly change to decimel while typing number but
In rml reports how can i change the current page number format from page:1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.