python
Deme2020
喜看今日路,胜读百年书
展开
-
Python调用(运行)外部程序
Python调用(运行)外部程序在Python中可以方便地使用os模块运行其他的脚本或者程序,这样就可以在脚本中直接使用其他脚本,或者程序提供的功能,而不必再次编写实现该功能的代码。为了更好地控制运行的进程,可以使用win32process模块中的函数。如果想进一步控制进程,则可以使用ctype模块,直接调用kernel32.dll中的函数。1 使用os.system函数运行其他程序2 使用She...转载 2018-03-07 16:30:52 · 3084 阅读 · 0 评论 -
pyinstaller打包运行报错failed to execute script *
打包时加上 --hidden-import=queue即可例如:pyinstaller --hidden-import=queue -w -F *.py原创 2019-02-01 10:13:48 · 1434 阅读 · 0 评论 -
python,解析CAN协议--------随意写
#coding:utf-8 #是用来指定文件编码为utf-8的import osimport codecs#涉及到文件目录有中文日文英文,其ASCII格式不一样from tkinter import *from tkinter import messagebox #导入tkMessageBoxfrom tkinter.filedialog import askdirector...原创 2018-08-17 10:13:55 · 7478 阅读 · 0 评论 -
python遍历文件
#file_list.py test file menuimport osimport redef list_cwd(): return os.listdir(os.getcwd())def files_cwd(): return [p for p in list_cwd() if os.path.isfile(p) ]def folders_ces(): return [p f...原创 2018-05-15 21:54:22 · 482 阅读 · 0 评论 -
在python中路径含有空格的解决方法
在python中路径含有空格的解决方法1.Application.filename=tkinter.filedialog.askopenfilename(filetypes=[('docx|doc格式','*.docx;*.doc')]) #获取的docx文件路径 通过函数tkinter.filedialog.askopenfilename()获取的路径使用/做分隔符 而word.Docum...原创 2018-03-08 16:36:31 · 25493 阅读 · 0 评论