Byte to Humanity
Simple Python 3 module that Convert Bytes to Megabyte, Kilobyte and ...
Table of Contents
Install
-
with pip
sudo pip3 install byte_to_humanity
or
sudo pip install byte_to_humanity
-
with git
git clone "https://github.com/mlibre/byte_to_humanity.git" cd byte_to_humanity/ sudo python setup.py install
Example
from byte_to_humanity.bth import convert_byte_to
bytes = 2048
print( bytes, 'byte =' , str( convert_byte_to( bytes , 'k') ) , 'kilobyte')
print( bytes, 'byte =' , str( convert_byte_to( bytes , 'm') ) , 'megabyte')
print( bytes, 'byte =' , str( convert_byte_to( bytes , 'g') ) , 'gigabyte')
print( bytes, 'byte =' , str( convert_byte_to( bytes , 't') ) , 'terabyte')
print( bytes, 'byte =' , str( convert_byte_to( bytes , 'p') ) , 'petabyte')
License
This project has no license!. You may consider this as Public Domain or CC0. also you can see license file.
More
-
Step By Step example
- Open terminal.
- Create a file like test.py.
-
Copy and past down code in test.py.
from byte_to_humanity.bth import convert_byte_to bytes = 2048 print( bytes, 'byte =' , str( convert_byte_to( bytes , 'k') ) , 'kilobyte') print( bytes, 'byte =' , str( convert_byte_to( bytes , 'm') ) , 'megabyte') print( bytes, 'byte =' , str( convert_byte_to( bytes , 'g') ) , 'gigabyte') print( bytes, 'byte =' , str( convert_byte_to( bytes , 't') ) , 'terabyte') print( bytes, 'byte =' , str( convert_byte_to( bytes , 'p') ) , 'petabyte')
-
Run code.
python3 test.py
or
python test.py