I am new to Tkinter and I have written a very simple Tkinter code that gets two inputs from the user and then executes another python script using os.system with passing two inputs as arguments. The code basically finds outs the difference in the CSV file.
Sharing the Tkinter code below.
import tkinter as tk
import os
def csv_diff():
global first
first = e1.get().replace('\\','\\\\')
second = e2.get().replace('\\','\\\\')
execute = 'python' +' '+'File_diff.py' + ' ' +first+' '+second
os.system(execute)
root = tk.Tk()
root.geometry("400x200")
root.configure(bg='green')
window = tk.Label(root,bg = "yellow", text="File Difference").grid(row=0)
tk.Label(root, text="1st CSV Location").grid(row=1)
tk.Label(root, text="2nd CSV Location").grid(row=2)
e1 = tk.Entry(root)
e2 = tk.Entry(root)
e1.grid(row=1, column=1)
e2.grid(row=2, column=1)
slogan = tk.Button(root,text="Run",command=csv_diff).grid(row=3, column=1, sticky=tk.W,pady=4)
root.mainloop()
The second code File_diff.py is
import sys
first_file_path = sys.argv[1]
second_file_path = sys.argv[2]
with open(first_file_path, 'r') as t1, open(second_file_path, 'r') as t2:
fileone = t1.readlines()
filetwo = t2.readlines()
with open('update.csv', 'a') as outFile:
outFile.write(fileone[0])
with open('update.csv', 'a') as outFile:
for line in filetwo:
if line not in fileone:
outFile.write(line)
with open('update.csv', 'a') as outFile:
for line in fileone:
if line not in filetwo:
outFile.write(line)
Now I want to make a single executable for these programs. I tried using pyinstaller but then it showed the error that no file File_diff.py doesn't exist.
I am not able to understand on how to make a single exe file for these two codes. Can anyone please explain on how to make a single executable file for this?