摘要: import matplotlib.pyplot as plt def drawArrow(A,B): fig = plt.figure() ax = fig.add_subplot(111) """ 箭头起始位置(A[0],A[1])和终点位置(B[0],B[1]) length_includes 阅读全文
posted @ 2023-07-14 09:53 Littlefish- 阅读(398) 评论(0) 推荐(0) 编辑
摘要: import psutil,pdb import subprocess def get_process_id(process_name): return def check_and_start_process(process_name, start_command): ss=psutil.proce 阅读全文
posted @ 2023-07-06 11:45 Littlefish- 阅读(8) 评论(0) 推荐(0) 编辑
摘要: ax3 = fig.add_axes(config['setpng']['colorbar']) # 四个参数分别是左、下、宽、长 cb3 = mpl.colorbar.ColorbarBase(ax3, cmap=_cmap,norm=norm) # set_colorbar_ticks(cb3, 阅读全文
posted @ 2023-06-12 14:05 Littlefish- 阅读(292) 评论(0) 推荐(0) 编辑
摘要: import queue,time import threading def worker(): while True: item = q.get() if item is None: break print(item) time.sleep(3) q.task_done() q = queue.Q 阅读全文
posted @ 2023-03-30 10:59 Littlefish- 阅读(48) 评论(0) 推荐(0) 编辑
摘要: import numpy as np from scipy.interpolate import griddata import matplotlib.pyplot as plt import pdb x_pos = np.array([ 0. , 11.748, 0. , -11.748, 0. 阅读全文
posted @ 2023-03-29 16:59 Littlefish- 阅读(23) 评论(0) 推荐(0) 编辑
摘要: # coding=utf-8 import os import sys,pdb import logbook #pip install Logbook from logbook import Logger,StreamHandler,FileHandler,TimedRotatingFileHand 阅读全文
posted @ 2023-03-27 11:39 Littlefish- 阅读(49) 评论(0) 推荐(0) 编辑
摘要: 使用官方的说法: classmethod(function) 中文说明: classmethod是用来指定一个类的方法为类方法,没有此参数指定的类的方法为实例方法,使用方法如下: class C: @classmethod def f(cls, arg1, arg2, ...): ... 看后之后真 阅读全文
posted @ 2023-03-07 14:13 Littlefish- 阅读(28) 评论(0) 推荐(0) 编辑
摘要: from tenacity import * def return_last_value(retry_state): print("执行回调函数") return retry_state.outcome.result() # 表示返回原函数的返回值 def is_false(value): retu 阅读全文
posted @ 2023-03-07 11:22 Littlefish- 阅读(46) 评论(0) 推荐(0) 编辑
摘要: def haversine(lat1,lon1,lat2,lon2): # 经度1,纬度1,经度2,纬度2 (十进制度数) """ Calculate the great circle distance between two points on the earth (specified in de 阅读全文
posted @ 2023-02-07 15:34 Littlefish- 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 利用matplotlib设置坐标轴主刻度和次刻度。(1)只显示次刻度标签位置,没有标签文本 from matplotlib.ticker import MultipleLocator, FormatStrFormatter xmajorLocator = MultipleLocator(a) #将x 阅读全文
posted @ 2023-02-06 17:25 Littlefish- 阅读(237) 评论(0) 推荐(0) 编辑
Document