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

  • SEARCH
  • Home
  • 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 8864519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:15:40+00:00 2026-06-14T16:15:40+00:00

Today I’m dealing with python code for the first time. Basically, have no time

  • 0

Today I’m dealing with python code for the first time. Basically, have no time for python tutorial. I’m Java background. If you could help me with python syntax, that would be great. Piece of code:

def fromData(headerdata, offset = 0):
        """Return a new Header object from the supplied binary data."""
        (id, flags, qdc, anc, nsc, arc,) = \
              struct.unpack_from(">6H", headerdata, offset)
        qr_ = (flags >> Header.OFFSET_QR) & 0x1

questions:

  1. what is this

    (id, flags, qdc, anc, nsc, arc,) = \
          struct.unpack_from(">6H", headerdata, offset)
    

    mean? What is it doing?

  2. why the “arc” ends with “,”?
  3. why qr is followed by “_”
  4. what is >6H. could you redirect me for the list of formats?
  • 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-14T16:15:41+00:00Added an answer on June 14, 2026 at 4:15 pm

    A C struct can be packed into flat binary data, which is what Python 2 calls a string. The struct module lets you take a string that represents one of these C structs, and “unpack” it into a Python data structure.

    To do so you call struct.unpack. You need to specify a format string (as defined in the linked docs), and it returns a tuple of values unpacked from the data.

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

Sidebar

Related Questions

Today is the first time I've used Python, so I'm sure this'll be an
Today I made a 64bit build of my project for the first time. Basically
Today i have a little problem containing a File Upload. First some Infos: Rubyversion:
today I have deployed my first MVC 2 application on Windows Server 2008, and
Today's problem in my code is kind of strange, and I could not reproduce
Today I started work on a small Java app. I have some experience with
Today I just had my first class on Java ee and dynamic web project...
Today I started learning libxml for the first time. And kept struggling to find
Today I ran my Node.js application in production mode for the first time and
Today I have had a problem with hiding text with text-indent: -9999px rule. I

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.