Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cut_pic
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dovahkiin
cut_pic
Commits
0f347ed8
Commit
0f347ed8
authored
Mar 27, 2024
by
dovahkiin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
复制一份excel文件到处理好的图片的路径之中。
parent
2cf75cd4
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
139 additions
and
7 deletions
+139
-7
main.py
main.py
+6
-2
outputUI.py
outputUI.py
+115
-5
ui_main.py
ui_main.py
+18
-0
No files found.
main.py
View file @
0f347ed8
...
...
@@ -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
()
# 将本地的表格复制过去
outputUI.py
View file @
0f347ed8
This diff is collapsed.
Click to expand it.
ui_main.py
View file @
0f347ed8
# 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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment