当前位置: 首页 > news >正文

速成网站建设网站的title

速成网站建设,网站的title,wordpress建站有广告吗,教育公司网站建设文案工具效果如下如所示 下面简单介绍一下操作流程 1.打开PyCharm软件 2.创建一个工程 3.给该工程命名 4.在main.py里面黏贴如下的代码 # This is a sample Python script. # Press ShiftF10 to execute it or replace it with your code. # Press Double Shift to search everyw…工具效果如下如所示 下面简单介绍一下操作流程 1.打开PyCharm软件 2.创建一个工程 3.给该工程命名 4.在main.py里面黏贴如下的代码 # This is a sample Python script. # Press ShiftF10 to execute it or replace it with your code. # Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. import serial import threading import timefrom tkinter import * from tkinter.ttk import * from tkinter import messageboxdef open_serial(a,b,c,d,e):global serprint(串口号:,a)print(波特率:,int(b))print(数据位:,c)print(停止位:,d)print(检验位:,e)bytesize serial.EIGHTBITSif c 7:bytesize serial.SEVENBITSprint(select SEVENBITS)if c 6:bytesize serial.SIXBITSprint(select SIXBITS)if c 5:bytesize serial.FIVEBITSprint(select FIVEBITS)stopbitsize serial.STOPBITS_ONEif d 2:stopbitsize serial.STOPBITS_TWOprint(select STOPBITS_TWO)paritysel serial.PARITY_NONEif e Odd:paritysel serial.PARITY_ODDprint(select Odd)if e Even:paritysel serial.PARITY_EVENprint(select EVEN)serserial.Serial(porta,baudrateint(b),bytesizebytesize,stopbitsstopbitsize,parityparitysel,timeout0.5)# ser serial.Serial(COM4, 9600, timeout1)def print_hi(name):# Use a breakpoint in the code line below to debug your script.print(fHi, {name}) # Press CtrlF8 to toggle the breakpoint.def print_log(log):time_start time.time()date time.strftime(%Y-%m-%d %H:%M:%S, time.localtime())print(f{date}-{log})def recv_hander():while 1:if ser.is_open:data ser.read(1024).decode(gbk)print_log(data)msgshow.insert(END, data)def create_recv_thread():global thth threading.Thread(targetrecv_hander)th.setDaemon(True)th.start()def msg_send():msg msginp.get()print_log(fsend{msg})if ser.is_open:ser.write(msg.encode(gbk))def open_com():print_log(open com)com_val comnum.get()baud_val baud.get() # 获取当前选定项目的值databit_val databit.get()stopbit_var stopbit.get()parity_var parity.get()print(com_val)print(baud_val)open_serial(com_val, baud_val, databit_val, stopbit_var, parity_var)if ser.is_open:messagebox.showinfo(标题,串口打开成功)create_recv_thread()def close_com():print_log(close com)if ser.is_open:ser.close()# Press the green button in the gutter to run the script. if __name__ __main__:print_hi(PyCharm)root Tk()root.geometry(768x512)root.title(串口工具)comnumvar StringVar()baudvar StringVar()databitvar StringVar()stopbitvar StringVar()parityvar StringVar()lb_com Label(root, text串口号)lb_com.place(relx0.01, rely0.05, relwidth0.1, relheight0.1)comnum Combobox(root, textvariablecomnumvar, values[COM1, COM2, COM3, COM4, ])comnum.place(relx0.08, rely0.075, relwidth0.1)comnum.current(3)lb_baud Label(root, text波特率)lb_baud.place(relx0.01, rely0.12, relwidth0.1, relheight0.1) #add 0.045baud Combobox(root, textvariablebaudvar, values[115200, 38400, 9600, 4800, ])baud.place(relx0.08, rely0.145, relwidth0.1) #add 0.025baud.current(2)lb_databit Label(root, text数据位)lb_databit.place(relx0.01, rely0.19, relwidth0.1, relheight0.1) #add 0.045databit Combobox(root, textvariabledatabitvar, values[8, 7, 6, 5, ])databit.place(relx0.08, rely0.215, relwidth0.1) #add 0.025databit.current(0)lb_stopbit Label(root, text停止位)lb_stopbit.place(relx0.01, rely0.26, relwidth0.1, relheight0.1)stopbit Combobox(root, textvariablestopbitvar, values[1, 2, ])stopbit.place(relx0.08, rely0.285, relwidth0.1)stopbit.current(0)lb_parity Label(root, text校验位)lb_parity.place(relx0.01, rely0.33, relwidth0.1, relheight0.1)parity Combobox(root, textvariableparityvar, values[None,Odd,Even,])parity.place(relx0.08, rely0.355, relwidth0.1)parity.current(0)btnopen Button(root, text打开串口, commandopen_com)btnopen.place(relx0.01, rely0.45, relwidth0.1, relheight0.05)btnclose Button(root, text关闭串口, commandclose_com)btnclose.place(relx0.12, rely0.45, relwidth0.1, relheight0.05)lb1 Label(root, text串口数据接收)lb1.place(relx0.25, rely0.05, relwidth0.7, relheight0.1)msgshow Text(root)msgshow.place(relx0.25, rely0.15, relwidth0.7, relheight0.3)lb2 Label(root, text串口数据发送)lb2.place(relx0.25, rely0.45, relwidth0.7, relheight0.1)msginp Entry(root)msginp.place(relx0.25, rely0.55, relwidth0.7, relheight0.1)btnsend Button(root, text发送, commandmsg_send)btnsend.place(relx0.35, rely0.86, relwidth0.3, relheight0.1)root.mainloop()# See PyCharm help at https://www.jetbrains.com/help/pycharm/ 5.执行脚本 6.如果有提示“No module named serial”需要安装 pyserial在终端命令行输入pip install pyserial如下图所示 7.在windows下安装一对虚拟串口可以下载vspd安装最终结果如下所示 8.使用第三方工具进行数据互发测试 9.将该工具打包成exe可执行文件 在命令行终端输入python -m pysimplegui-exemaker.pysimplegui-exemaker 最后点击“Make EXE”生成如下所示的exe文件
http://wiki.neutronadmin.com/news/384095/

相关文章:

  • wordpress怎么修改图片大小seo 适合哪些行业
  • 动软代码生成器 做网站无锡手机网站制作费用
  • 网站如何设置默认首页友情链接交换网址大全
  • 广州市增城区建设局网站互联网行业五行属什么
  • 二级a做爰片免费网站响应式网站是什么意思
  • 东莞网站设计资讯学年论文网站建设
  • 成立网站是不是需要先成立公司网站升级需要什么
  • 长春网站建设团队seo为什么要进行外部优化
  • lamp 做网站四川今天刚刚发生的新闻
  • 网站项目方案外贸订单在哪里能接到
  • 临沂河东区建设局网站企业营销网络建设
  • 网站开发学校有哪些自建房平面图设计软件
  • 北京响应式网站建设报价网站页面布局设计思路
  • 电脑网页视频下载seo企业网站模板
  • 开县网站建设个人或主题网站建设 实验体会
  • 怎样做信息收费网站安徽股票配资网站建设
  • 多语言企业网站开发五百丁简历模板官方网站
  • 网站建设制作首页流程自己做网站花多少钱
  • dw网站建设字体颜色图文广告培训班多少钱
  • 试剂产品商城网站建设网站制作属于什么专业
  • 广告设计图片网站wordpress媒体库子目录
  • 潍坊网站建设套餐做国际贸易的有哪有个网站
  • 网站设计论文范文大全集网站开发环境安装程序
  • 沧州网站制作网站搭建什么意思
  • 网站开发的发展趋势如何发布网站
  • 临安区规划建设局网站网站建设傲鸿
  • 做二手车按揭的网站沙田镇仿做网站
  • seo网站优化策划书网站建设的难点
  • 用自己电脑做主机做网站网站建设具体流程
  • 凡客帆布鞋莱芜seo排名