byte_to_humanity

Convert Bytes to Megabyte, Kilobyte and ...


Keywords
convert byte kilobyte megabyte gigabyte
License
Other
Install
pip install byte_to_humanity==1.5

Documentation

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

    1. Open terminal.
    2. Create a file like test.py.
    3. 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')
    4. Run code.

      python3 test.py

      or

      python test.py