Skip to main content

Input/output utirites of a bit-basis file

Project description

# bitio

Input/output utirites of bit basis file

## How to use

from bitio import bit_open

f = bit_open(file_name, "r")
x = # return 1 or 0
x = f.read_bits(count) # return int

f = bit_open(file_name, "w")
f.write(bit) # write 1 if bit else 0
f.write_bits(bits, count) # write 'count bits'

These are same

f.write_bits(bits, count)

for i in range(count-1, -1, -1):
if bits & (1 << i):

othe interface

l = []
wrapper = ByteWrapper(l.append)
f = bit_wrap(wrapper, "w")
f.write_bits(0b110000101, 10)
print l # ["a"]
print l # ["a", "@"]

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for bitio, version 0.2
Filename, size File type Python version Upload date Hashes
Filename, size bitio-0.2.tar.gz (2.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page