Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Convert Bytes to Megabyte, Kilobyte and ...

Project Description
Please visit https://github.com/mlibre/byte_to_humanity
This document copied from above link.

# Byte to Humanity
Simple Python 3 module that Convert Bytes to Megabyte, Kilobyte and ...

## Table of Contents
* Install
+ with pip
+ with git
* Example
* License
* More
* Step By Step example


### 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
Release History

Release History

This version
History Node

1.5

History Node

1.4

History Node

1.3

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
byte_to_humanity-1.5.tar.gz (3.5 kB) Copy SHA256 Checksum SHA256 Source Jul 5, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting