Commit 0f347ed8 authored by dovahkiin's avatar dovahkiin

复制一份excel文件到处理好的图片的路径之中。

parent 2cf75cd4
......@@ -166,7 +166,7 @@ if __name__ == '__main__':
else:
while True:
try:
wb.save('image coordinate size.xlsx')
wb.save(excel_file_name)
break
except PermissionError:
print("please close the Excel file")
......@@ -265,4 +265,8 @@ if __name__ == '__main__':
sheet1[translation_index] = translation
sheet1[Original_index] = Original
start_line_number += 1
wb.save('image coordinate size.xlsx')
wb.save(excel_file_name)
wb.close()
# 将本地的表格复制过去
This diff is collapsed.
# import resource
import os
import shutil
import sys
import time
from ctypes import *
......@@ -225,6 +226,23 @@ class Pyqt5_Cut_psd(QtWidgets.QMainWindow, Ui_Form):
pass
def cut_pic_ok(self):
# 复制一份excel到每个psd的路径下方
paths = set()
for psd_name_i in self.let_psd_name.text().split(","):
psd_name = psd_name_i.replace("'","").strip()
# paths.add(os.path.split(psd_name)[0])
paths.add(os.path.splitext(psd_name)[0])
print(paths)
excel_file_name = 'image coordinate size.xlsx'
for psd_path in paths:
# 判断psd_path是否等于当前路径
if os.path.samefile(psd_path, os.getcwd()):
continue
# 判断是否存在excel文件
if os.path.exists(os.path.join(psd_path, excel_file_name)):
os.remove(os.path.join(psd_path, excel_file_name))
shutil.copy(excel_file_name, psd_path)
QMessageBox.information(self, "成功", '图片已经切成功放入对应文件夹中,\n坐标位于《image coordinate size.xlsx》文件中。', QMessageBox.Yes, QMessageBox.Yes)
self.statusbar.clearMessage()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment