I have a code here, that I want to send to my friend. The problem is that it has a path specified. How would I make it so it would correct the path to its own folder?
Code:
# importing only those functions
# which are needed
from tkinter import *
from tkinter.ttk import *
# creating tkinter window
root = Tk()
root.title("Vidman-féle Instant Depresszió Generátor")
root.geometry('600x200')
root.configure(background='white')
lbl = Label(root, text="0").pack(side = TOP)
txt = Entry(root,width=10).pack(side =TOP)
def clicked():
res = int(float(Entry.get())) * int(60000)
lbl.configure(text= res)
# Creating a photoimage object to use image
photo = PhotoImage(file = r"C:\\Users\\regok\\Desktop\\VFIDG\\arrow.png")
# here, image option is used to
# set image on button
Button(root, text = 'Click Me !', image = photo, command=clicked).pack(side = BOTTOM)
mainloop()
The path is: C:\Users\regok\Desktop\VFIDG\arrow.png. I would like to set it as currentfolder\arrow.png