質問編集履歴
1
コードの追記をしました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -31,6 +31,60 @@
|
|
31
31
|
|
32
32
|
|
33
33
|
```python
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
#変数の作成とセット
|
38
|
+
|
39
|
+
today = datetime.date.today().strftime('%Y%m%d')
|
40
|
+
|
41
|
+
arr = []
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
def pass_set(mode):
|
46
|
+
|
47
|
+
org_dir = e1.get()
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
if mode == 'emb':
|
52
|
+
|
53
|
+
fld_dir = org_dir + '\emboss\'
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
os.makedirs(fld_dir, exist_ok=True)
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
#フォルダ内の画像をリスト化
|
62
|
+
|
63
|
+
arr.extend(glob.glob(org_dir + "/*.png"))
|
64
|
+
|
65
|
+
return org_dir,fld_dir
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
def open_folder():
|
70
|
+
|
71
|
+
org_dir = e1.get()
|
72
|
+
|
73
|
+
if org_dir is None:
|
74
|
+
|
75
|
+
folder_path = 'C:'
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
else:
|
80
|
+
|
81
|
+
folder_path = org_dir
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
folder_path = tk.filedialog.askdirectory(initialdir = folder_path)
|
86
|
+
|
87
|
+
e1.insert(tk.END,folder_path)
|
34
88
|
|
35
89
|
|
36
90
|
|
@@ -80,4 +134,56 @@
|
|
80
134
|
|
81
135
|
|
82
136
|
|
137
|
+
win=tk.Tk()
|
138
|
+
|
139
|
+
win.title("画像変換")
|
140
|
+
|
141
|
+
win.minsize(400,400)
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
#入力boxの生成
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
e8=tk.Entry(win,width=30)
|
150
|
+
|
151
|
+
e8.place(x=125,y=240)
|
152
|
+
|
153
|
+
e9=tk.Entry(win,width=30)
|
154
|
+
|
155
|
+
e9.place(x=125,y=290)
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
#ラベルの生成
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
label8=tk.Label(win,text="エンボス効果(x)\n(-3- 3)",bg="white")
|
166
|
+
|
167
|
+
label8.place(x=5,y=240)
|
168
|
+
|
169
|
+
label9=tk.Label(win,text="エンボス効果(y)\n(-3- 3)",bg="white")
|
170
|
+
|
171
|
+
label9.place(x=5,y=290)
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
#ボタンの作成
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
btn8=tk.Button(win,text="実行",command=lambda:emboss())
|
180
|
+
|
181
|
+
btn8.place(x=325,y=290)
|
182
|
+
|
183
|
+
win.mainloop()
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
83
189
|
```
|