2019-04-27から1日間の記事一覧
スレッド関係 import threading start() threading.Thread( xx,args=(,), kwargs={}) setDaemon(True) lock= threading.Lock() lock.acquire(), lock.release() lock = threading.Rlock() with lock: Semaphore(n) with: queue.Queue() put(x) get() qsize()…
read write #coding:utf-8 f = open('test.txt','r') for row in f: print row.strip() f.close() with open('test.txt','r') as f: for row in f: print row.strip() #coding:utf-8 f = open('test.txt','w') f.write('hoge\n') f.close() 'a' とすると追記…
基本 from datetime import datetime datetime.now().strftime("%Y/%m/%d %H:%M:%S")
概要 定期的に採取したセンサーデータをプロットする。 dump辞書のad番地にセンサーデータが格納されている。 dump [ad]=words ad番地の名前がnameで、値がval。 regnames[name]=ad regvals[name]=val dumpからregvalsに値をコピーし、現在時刻と共にhistory…
Python - pythonのopenpyxlでexcelのグラフを作った際の横軸|teratail
値による色付きグラフ python matplotlibでの色付きグラフ。 線分単位で値に応じて色を指定し、一本のグラフを引く。 import matplotlib.pyplot as plt import math import matplotlib N=128 f = 8 omg = [i*f*2*math.pi/N for i in range(N)] sig = [math.s…
早く知っておきたかったmatplotlibの基礎知識、あるいは見た目の調整が捗るArtistの話 - Qiita