plotserver的python api。
plotserver-api的Python项目详细描述
绘图服务器API
用于与PlotServer通信的python api。
如何使用
- 在您选择的绘图仪服务器上注册用户;
- 获取API密钥;
- 安装此软件包:
$ pip install plotserver-api
- 将API集成到应用程序中:
fromplotserver_apiimportPlotServerAPI,Project# Set key and API addresskey=b'5uSN9ojYpMiI7gQ5k5NWR6kYvenDX97CmxC5aaUGdH8='api_url="http://someadress"# Initialize API managerapi=PlotAPI("alartum",key,api_url,verbose=True)# And create new project withproject=Project("project1",api,fresh_start=True)# Add tags for different data to be tracked project.add_files(["sin","cos"])# And inform the server project.prepare_project()importmatht=0whileTrue:# Add new data to the manager project.add_frame("sin",t,math.sin(t**2/50))project.add_frame("cos",t,math.cos(t/20))# And send frames when doneproject.send_frames()time.sleep(2)t+=1