Python实现的解压缩软件及excel转图片工具源代码,基于pyqt5
Python实现的解压缩软件源码及excel转图片工具源代码,基于pyqt5
1、GUI.py和GUI.ui:绘制界面相关
2、 UnRAR64.dll和compress.py:压缩解压相关
3、 excel2image.py:excel转图片相关
4、 main.py:主入口
完整程序下载地址:Python实现的解压缩软件及excel转图片工具源代码
main.py
import os.path
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow
from GUI import *
from excel2image import *
from compress import *class MyWindow(QMainWindow, Ui_MainWindow):def __init__(self, parent=None):super(MyWindow, self).__init__(parent)self.setupUi(self)def debugPrint(self, msg):previous = self.plainTextEdit_debug.toPlainText().strip()self.plainTextEdit_debug.setPlainText(previous+'\n'+str(msg))# print(previous+'\n'+str(msg))QApplication.processEvents()def pathFilter(self, path):if path.startswith('file://'):path = path[8:]return pathdef uncompress_start(self):self.pushButton_uncompress_start.setEnabled(False)self.debugPrint('>> 开始解压')filePath = self.pathFilter(self.textEdit_uncompress_filePath.toPlainText().strip())# file:///C:/Users/SXF/Desktop/Converted files.zipif os.path.isfile(filePath):self.debugPrint('>> 是压缩包,即将进入解压模式!')if filePath.endswith('rar'):self.debugPrint('>> rar格式!')try:rar_uncompress(filePath, debugPrint=self.debugPrint)except Exception as e:self.debugPrint(">> 解压出错: " + str(e))elif filePath.endswith('zip'):self.debugPrint('>> zip格式!')try:zip_uncompress(filePath, debugPrint=self.debugPrint)except Exception as e:self.debugPrint(">> 解压出错: " + str(e))else:self.debugPrint('>> 格式不支持!')else:self.debugPrint('>> 不是压缩包!')self.pushButton_uncompress_start.setEnabled(True)def compress_start(self):self.pushButton_compress_start.setEnabled(False)self.debugPrint('>> 开始压缩')dirPath = self.pathFilter(self.textEdit_compress_filePath.toPlainText().strip())if os.path.isdir(dirPath):self.debugPrint('>> 是文件夹,即将进入压缩模式!')zip_compress(dirPath, debugPrint=self.debugPrint)else:self.debugPrint('>> 不是文件夹!')self.pushButton_compress_start.setEnabled(True)def excel2image_start(self): # file:///C:/Users/SXF/Desktop/学术成果一览表.xlsxself.pushButton_excel2image_start.setEnabled(False)self.debugPrint('>> 开始Excel转图片')filePath = self.pathFilter(self.textEdit_excel2image_filePath.toPlainText().strip())self.debugPrint(">> 待转换文件为: " + filePath)if os.path.exists(filePath):try:res = excel2image(filePath, debugPrint=self.debugPrint)if res:downloadFile(res['FileName'], res['FolderName'], debugPrint=self.debugPrint)except Exception as e:self.debugPrint(">> 转换出错: "+str(e))else:self.debugPrint(">> 文件不存在")self.pushButton_excel2image_start.setEnabled(True)if __name__ == '__main__':app = QApplication(sys.argv)myWin = MyWindow()myWin.show()sys.exit(app.exec_())
完整程序下载地址:Python实现的解压缩软件及excel转图片工具源代码
Python实现的解压缩软件及excel转图片工具源代码,基于pyqt5相关推荐
- python制作解压工具_使用python制作一个解压缩软件
python实现解压缩的重要模块就是--zipfile,其次是os 安装zipfile模块 首先得安装zipfile模块,打开cmd输入一下命令即可安装 pip install zipfile os是 ...
- python编写一个软件-使用python制作一个解压缩软件
python实现解压缩的重要模块就是――zipfile,其次是os 安装zipfile模块 首先得安装zipfile模块,打开cmd输入一下命令即可安装 pip install zipfile os是 ...
- python如何制作一个工程软件_使用python制作一个解压缩软件
python实现解压缩的重要模块就是--zipfile,其次是os 安装zipfile模块 首先得安装zipfile模块,打开cmd输入一下命令即可安装 pip install zipfile os是 ...
- python如何制作一个工程软件_如何利用python制作一个解压缩软件-Go语言中文社区...
如何利用python制作一个解压缩软件 python实现解压缩的重要模块就是--zipfile,其次是os 安装zipfile模块 首先得安装zipfile模块,打开cmd输入一下命令即可安装 pip ...
- python应用系列教程——python操作office办公软件(excel)
全栈工程师开发手册 (作者:栾鹏) python教程全解 python操作office办公软件(excel).本文对涉及xls文件读写上不方便.如果你需要通过python读写xls文件,可以参考htt ...
- 如何利用python制作一个解压缩软件
文章目录 如何利用python制作一个解压缩软件 安装zipfile模块 编写核心代码 安装tkinter模块 整合代码 安装pyinstaller模块 打包程序为可执行文件 打包程序为可执行文件 如 ...
- 常用工具类五 Excel转图片工具类
市面上大多数excel转图片为收费工具,借鉴他人用awt的Graphics2D自己实现的工具类,只涉及poi依赖. /** * 版权: taylor * 描述: 将excel转为图片工具类 * 创建时 ...
- excel转图片工具类
添加依赖 <repository><id>AsposeJavaAPI</id><name>Aspose Java API</name>< ...
- android rar工具,安卓解压缩软件-ZArchiver Pro 解压工具下载v0.8.5 安卓版-安卓解压神器西西软件下载...
ZArchiver解压工具:强大的压缩/解压工具,能够解压的文件类型非常广泛. 支持压缩和解压rar,zip,7z等等,支持压缩和解压带有密码保护的压缩文档,支持unicode格式文件名(UTF-8) ...
最新文章
- C 编程异常 — /usr/bin/ld: 找不到 -lm
- RT73 wifi无线网卡驱动移植过程 和wpa支持
- 判断pc浏览器和手机浏览器方法
- php 频繁dom和 文件,性能优化之为什么不要频繁操作DOM
- spring 安全编码_Spring安全性和密码编码
- [渝粤教育] 西南科技大学 中国现代文学 在线考试复习资料
- 车联网大数据框架_大数据基础:ORM框架入门简介
- 软考系统架构师笔记-综合知识重点(四)
- oracle mseq,一次RMAN备份报错的诊断过程(一)
- short类型占16位,可以赋给short类型的最大值32767,最小值为-32768
- 【一分钟知识】七种损失函数
- HTTP1.0/1.1/2.0特性对比_转
- dubbo超时机制原理
- PMP课程笔记:第1-3章 引论 项目运行环境 项目经理
- P1930 亚瑟王的宫殿
- java node对比_服务端I/O性能:Node、PHP、Java、Go的对比
- 百度搜索稳定性问题分析的故事(上)
- 加密通信(三):CA证书
- 解决树莓派鼠标延迟/迟滞问题解决
- Shape的属性介绍及使用