Coder Social home page Coder Social logo

easy_util's Introduction

Easy_util (Python3 scripts)

Easy_util provide memory usage, flush animation during calculation and so on.

Requirements

  • Python > 3.5.1

Set Up

Install virtualenv. (for protecting your Home environment.)

python3 -m pip install -U pip setuptools
python3 -m pip install virtualenv
# or
pip3 install virtualenv

activate virtualenv

virtualenv -p python3 venv
source venv/bin/activate
# Removing virtual environment
# (venv) deactivate

build & install

pip install git+https://github.com/Moguf/easy_util.git
# or
git clone https://github.com/Moguf/easy_util.git
cd easy_util
python setup.py build
python setup.py install

How to use

from easyutil import CmdAnimation, MemLimit

## For Command Line Animation.
anm = CmdAnimation()
anm.start()
# Your function here.
anm.end()

## For Memory Limit
memutl = MemUtil()
memutl.set(8)
# Memory Limit is 8Gb.

When you want to get a big data from web server and know download progress, you had better to use progress-mode.

from urllib.request import urlopen, urlretrieve
from easyutil import CmdAnimation

## For Command Line Animation.
url = "http\://hoge.com/target.html"
filename = "target.html"
meta = urlopen(url).info()
size = int(meta.get_all("Content-Length")[0])
anm = CmdAnimation('progress', filename=filename, size=size)
anm.start()
urlretrieve(url, filename)
anm.close()
"""
ex)
[======>                       ] 12.01%
"""

easy_util's People

Contributors

moguf avatar

Watchers

James Cloos avatar  avatar

easy_util's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.