Python Forum
Read bit by bit from a 128 bit number
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Read bit by bit from a 128 bit number
#4
If x is a binary number as a string int(x, 2) will return an integer with the correct value.

>>> b = '1101'
>>> int(b)
1101
>>> int(b, 2)
13
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Read bit by bit from a 128 bit number - by vdhingra - Apr-15-2019, 11:48 PM
RE: Read bit by bit from a 128 bit number - by ichabod801 - Apr-16-2019, 06:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Read directory listing of files and parse out the highest number? cubangt 5 2,385 Sep-28-2022, 10:15 PM
Last Post: Larz60+
  csv.reader(): Limit the number of columns read in Windows Pedroski55 9 5,262 Jan-23-2021, 01:03 AM
Last Post: pjfarley3
  Can't read url when specifying more than a specific number of bytes deivid 3 3,089 Aug-13-2018, 02:24 PM
Last Post: deivid

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020