摘要: import matplotlib.pyplot as plt import numpy as np x=np.linspace(-3,3,50) y1=x*2+1 y2=x**2 plt.plot(x,y1) plt.figure(num=3,figsize=(8,5)) plt.plot(x,y2) plt.plot(x,y1,color="red",linewidth=1.0,line... 阅读全文
posted @ 2018-12-06 17:54 萧白白 阅读(305) 评论(0) 推荐(0)
摘要: #gca='get current axis' ax = plt.gca() ax.spines['right'].set_color('none') ax.spines['top'].set_color('none') ax.xaxis.set_ticks_position('bottom') a 阅读全文
posted @ 2018-12-06 16:48 萧白白 阅读(1199) 评论(0) 推荐(0)
摘要: import matplotlib.pyplot as plt import numpy as np x=np.linspace(-3,3,50) y1=x*2+1 y2=x**2 plt.plot(x,y1) plt.figure(num=3,figsize=(8,5)) plt.plot(x,y2) plt.plot(x,y1,color="red",linewidth=1.0,line... 阅读全文
posted @ 2018-12-06 16:20 萧白白 阅读(189) 评论(0) 推荐(0)
摘要: import threading def job1(): global A, lock lock.acquire() for i in range(10): A += 1 print('job1', A) lock.release() def job2(): global A, lock lock.acquire... 阅读全文
posted @ 2018-12-06 15:40 萧白白 阅读(247) 评论(0) 推荐(0)
摘要: import threading import time from queue import Queue def job(l,q): for i in range(len(l)): l[i] =l[i]**2 q.put(l) def multithreading(): q = Queue() threads = [] date =[[... 阅读全文
posted @ 2018-12-06 13:43 萧白白 阅读(164) 评论(0) 推荐(0)
摘要: import threading import time def thread_job(): print("T1 start\n") for i in range(30): time.sleep(0.1) print("T1 finish\n") def T2_job(): print("T2 start\n") print("T2 f... 阅读全文
posted @ 2018-12-06 13:11 萧白白 阅读(168) 评论(0) 推荐(0)
摘要: import threading def thread_job(): print("This is an added Thread,number is %s"% threading.current_thread()) def main(): #添加线程 added_thread =threading.Thread(target=thread_job) added... 阅读全文
posted @ 2018-12-06 12:48 萧白白 阅读(261) 评论(0) 推荐(0)