-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
67 lines (54 loc) · 2.11 KB
/
app.py
File metadata and controls
67 lines (54 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
from PyQt5.QtWidgets import QApplication, QMainWindow
import sys
import os
import library
from ast import For
from PIL import Image
from nft_generator import arrayAppendLink
class MainRsa(QMainWindow):
def __init__(self):
super(MainRsa, self).__init__()
self.main = library.Ui_MainWindow()
self.main.setupUi(self)
self.show()
self.main.calculaterNft.clicked.connect(self.replayTest)
self.main.generatorNgt.clicked.connect(self.generatorNft)
linkArray = []
arrayLink = []
linkOneArray = []
linkTwoArray = []
linkFinal = ''
x = 0
def arrayAppendLink(self, linkArray):
self.linkArray = []
for root, dirs, files in os.walk(linkArray):
for file in files:
self.linkArray.append(os.path.join(root,file))
return self.linkArray
def replayTest(self):
linkOne = self.main.linkOne.text()
linkOne = linkOne.replace('\\', '/')
print('linkOne' + linkOne)
linkTwo = self.main.linkTwo.text()
linkTwo = linkTwo.replace('\\', '/')
print('linkTwo' + linkTwo)
linkFinal = self.main.linkFinal.text()
self.linkFinal = linkFinal.replace('\\', '/')
self.linkOneArray = self.arrayAppendLink(linkOne)
print('self.linkOneArray' , self.linkOneArray )
self.linkTwoArray = self.arrayAppendLink(linkTwo)
print('self.linkTwoArray', self.linkTwoArray )
def generatorNft(self):
for linkOneArrayFor in self.linkOneArray:
linkOneArrayFor = Image.open(linkOneArrayFor)
for linkTwoArrayFor in self.linkTwoArray:
linkTwoArrayFor = Image.open(linkTwoArrayFor)
linkTwoArrayFor.paste(linkOneArrayFor, (0,0), linkOneArrayFor)
linkTwoArrayFor.save(self.linkFinal + "/" + str(self.x) + ".png")
self.main.consoleTxt.setText(str(self.x))
self.x = self.x + 1
self.main.consoleTxt.setText('Завершено')
if __name__ == "__main__":
app = QApplication(sys.argv)
window = MainRsa()
sys.exit(app.exec_())