python 界面编程 并执行sh命令
来源:互联网 发布:windows视频截gif 编辑:程序博客网 时间:2024/06/06 23:57
#!/usr/bin/python# -*- coding: UTF-8 -*-from Tkinter import * # 导入 Tkinter 库import threadimport timeimport osclass MessageShow:def __init__(self):#传入参数 消息内容 和这条消息显示的时间#消息显示的时间#self.WaitTime=timeself.root = Tk() # 创建窗口对象的背景色self.root.wm_title("机器人控制主窗口")#title#居中显示self.root.resizable(False,False)self.root.update() # update window ,must docurWidth = self.root.winfo_reqwidth() # get current widthcurHeight = self.root.winfo_height() # get current heightscnWidth,scnHeight = self.root.maxsize() # get screen width and height# now generate configuration informationtmpcnf = '%dx%d+%d+%d'%(200,100,(scnWidth-curWidth)/2,(scnHeight-curHeight)/2)self.root.geometry(tmpcnf)#l1=Label(self.root,text=message,background="yellow")#font=("宋体", 12, "normal")#l1=Label(self.root,text=message,foreground="red")#l1.pack(side=TOP,expand=YES)b1=Button(self.root,text="启动机器人虚拟驱动",command=self.b1Command)#b1['width']=10#b1['height']=1b1.pack(side=TOP,expand=YES)b2=Button(self.root,text="启动机器人虚拟路径导航界面",command=self.b2Command)b2.pack()b3=Button(self.root,text="启动机器人movebase",command=self.b3Command)b3.pack()#thread.start_new_thread(self.autoDestory,()) self.root.mainloop() # 进入消息循环def b1Command(self):os.system("gnome-terminal -x bash -c \"roslaunch agv fakeMinimalAGV.launch\"")def b2Command(self):os.system("gnome-terminal -x bash -c \"roslaunch agv mplannerfake.launch\"")def b3Command(self):os.system("gnome-terminal -x bash -c \"roslaunch agv move_base.launch\"")def autoDestory(self):time.sleep(self.WaitTime)self.root.destroy()if __name__=='__main__':MessageShow()
0 0
- python 界面编程 并执行sh命令
- sh, 批量执行Linux命令
- sh, 批量执行Linux命令
- Python之连接linux并执行命令
- Python实现SSH远程登陆,并执行命令!
- Python执行命令行命令并获取输出
- python 执行sh脚本文件
- linux新建.sh文件并可以执行
- Linux sh、source和.命令执行.sh文件的区别
- Linux sh、source和.命令执行.sh文件的区别
- 执行某个目录下的.sh命令
- Red Hat下执行sh命令文件
- Linux sh执行多行命令
- 分布式集群批量执行命令sh脚本
- sh 获取 执行python的结果:$?
- C#如何调用Python执行脚本,并将执行结果显示值显示至C#界面
- C#如何调用Python执行脚本,并将执行结果显示值显示至C#界面
- Python pexpect通过ssh批量登录并执行命令
- 求1+2+3+...+n(逻辑题)
- (五)play之yabe项目【评论】
- Android-Matrix矩阵
- Unity简单触屏判断
- SDWebImage源码解读 之SDWebImageDownloaderOperation
- python 界面编程 并执行sh命令
- 存储过程与触发器的区别
- codeforces 760E or 759C 【线段树维护后缀和】
- 三 . css语法、样式表
- PAT甲级1032
- 重载与重写
- spring boot 学习(五)SpringBoot+MyBatis(XML)+Druid
- 指针数组&数组指针
- 你的管理,为什么没带出优秀的团队?