ichuan.net

自信打不死的心态活到老

命令行下的spark画图

创意来源:https://github.com/holman/spark

python 实现:https://github.com/ichuan/yc-lib/blob/master/python/spark.py

使用方法:

将数值以参数传入

admin@test: ~$ python spark.py 0 30 55 80 33 150  
▁ ▂ ▃ ▅ ▂ █

通过管道传入

admin@test: ~$ curl http://earthquake.usgs.gov/earthquakes/catalogs/eqs1day-M1.txt --silent|sed '1d' |cut -d, -f9 |tr "\n" ',' |sed 's/ //g' |python spark.py
▁ ▂ ▂ ▁ ▂ ▁ ▁ ▂ ▁ ▃ ▂ ▂ ▁ ▁ ▂ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▅ ▂ ▁ ▂ ▁ ▁ ▁ ▅ ▁ ▂ ▂ ▅ ▂ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▂ ▁ ▃ ▁ ▁ ▁ ▁ ▄ ▂ ▃ ▁ ▄ ▁ ▂ ▁ ▁ ▁ ▁ ▁ ▅ ▁ ▁ ▁ ▄ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▂ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▂ ▂ ▂ ▂ ▁ ▁ ▁ ▂ ▅ ▁ ▁ ▁ ▂ ▅ ▄

Comments