Sirius' blog

黄沙百战穿金甲,不破楼兰誓不还

💼 Back to categories list

python

A good script to visualize footprint

📅 2018-04-29 12:43:52 +0000
Visualization of footprint source: shengxinjing/footprint I occasionally found this repo in GitHub, and it’s really beautiful. It use the api of baidu map to get the location of city or area of the given name, and then draw it on the map. It also used the echart script of baidu (I think this is the most difficult part, you need to read the document in detail, once I want to add a static label on it, but I didn’t succeed. And I also want to use api of google map to get the location of citys ...

convert image to ascii art

📅 2018-02-21 07:48:07 +0000
use python to convert image to ascii art Recently, I found a python script which can convert image whose size is smaller than 1MB to ascii drawing. and there is an example: result: doraemon.txt1 This is the code of that script asciinator.py2 import sys from PIL import Image import numpy as np # settings chars = np.asarray(list(' -"~rc()+=01exh%')) SC, GCF, WCF = 1/10, 1, 7/4 # read file img = Image.open(sys.argv[1]) # process S = ( round(img.size[0]*SC*WCF), round(img.size[1]*SC) )...

Mass send message by python in QQ

📅 2018-02-15 13:54:03 +0000
some experiences for sending QQ message by python I have many friends in QQ, so it’s a tired job to send message to greet when the festival came. I saw a project not long ago for giving suggesstions to newers in the community group, and I contacted qqbot at that time: QQbot qqbot is a robot for QQ based on Tencent SmartQQ protocol realized by python, you can use it to write your own QQ bot in python. Installation: pip install qqbot Usage: usage is on the github, and in Chinese, I won’t copy ...

python in data processing of physics experiment

📅 2018-02-13 02:48:32 +0000
some experiences of using python to deal with data in physics experiment of USTC. There are many modules in python, such as matplotlib, numpy, scipy, sympy and so on. So, you can do many things with python. Some times, there are many data to process in physics experiment of USTC, so, why not use python to help you? ipython is a good interactive shell of python, it have syntax highlighting, auto complete, auto indentation and so on, and it doesn’t occupy much. You can record your data in li...