I'm trying to use os.system()
and a .format()
for a program that hides Archive in Image. I don't understand , why the OUTPUT.jpg
doesn't save in a current directory. Also, I have a GUI for it, it's easy enough to use. But Can't get an output file. It doesn't just create. Please, can you help?
Here is a code:
import tkinter as tk
import tkinter.filedialog as f
import os
def access(event):
global arch
arch = f.askopenfilename()
txt['text'] = 'Choose a picture'
btn_1.destroy()
btn_2.grid(row=1, column=1)
def access2(event):
global img
img = f.askopenfilename()
btn_2.destroy()
os.system('copy {} + {} {}/OUTPUT.jpg'.format(img, arch, os.getcwd()))
txt['text'] = 'Ready.'
root = tk.Tk()
txt = tk.Label(root, text='Choose archive')
btn_1 = tk.Button(root, text='Выбрать')
btn_2 = tk.Button(root, text='Выбрать')
txt.grid(row=0, column=1)
btn_1.grid(row=1, column=1)
btn_1.bind('<Button-1>', access)
btn_2.bind('<Button-1>', access2)
root.mainloop()