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 6665163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:41:38+00:00 2026-05-26T02:41:38+00:00

In Python, when I try to read in an executable file with ‘rb’, instead

  • 0

In Python, when I try to read in an executable file with ‘rb’, instead of getting the binary values I expected (0010001 etc.), I’m getting a series of letters and symbols that I do not know what to do with.

Ex: ???}????l?S??????V?d?\?hG???8?O=(A).e??????B??$????????:    ???Z?C'???|lP@.\P?!??9KRI??{F?AB???5!qtWI??8???!ᢉ?]?zъeF?̀z??/?n??

How would I access the binary numbers of a file in Python?

Any suggestions or help would be appreciated. Thank you in advance.

  • 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-05-26T02:41:39+00:00Added an answer on May 26, 2026 at 2:41 am

    That is the binary. They are stored as bytes, and when you print them, they are interpreted as ASCII characters.

    You can use the bin() function and the ord() function to see the actual binary codes.

    for value in enumerate(data):
       print bin(ord(value))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to read a binary file in python. This is first written by
I have a python file like this import urllib2 try: data = urllib2.urlopen('http:....').read() except
When I try to use curl or file_get_contents to read something like http://example.com/python/json/ from
Using Python, what's the correct way to set a file to be read-only when
I'm try to insert values into my sqlite table using a python script. It
Whenever I try to open a .csv file with the python command fread =
What's wrong with this Python file-read test? import os import sys fileList = os.listdir(sys.argv[1])
I want to read a .csv file in python. I don't know if the
I'm having some difficulties while parsing a binary STL file with Python (2.7.1 32-bit
I am trying to read binary data from sys.stdin using Python 2.7 on Windows

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.