I finished up my first GUI project that allows the user to open any PDF file by wither typing a product key, or manually find it using a tree view. I have all the files in the same folder as the application, the problem is that when I used pyinstaller to make it an .exe it wont pull up. and anytime I move it nothing pulls up because the code is linked to that specific location. my question is how do you write it to where the filepath is linked to a specific folder, and even if said folder moves, it still accesses those files?
def Product_Look_UP():
if inPro.get()== "24LPPS":
Label(root, text= f"Searching for {inPro.get()}..." , fg = "Orange").grid(row = 3 , column = 0)
import webbrowser as wb
wb.open_new(r'C:\Users\user\Desktop\Product Finder\Data\Vender\vender\Ladder Pulls\24 in\Polished Stainless\LADDER PULL.pdf')
Essentially how do make "C:\Users\user\Desktop"
be where ever the "Product Finder"
folder is, whether it be on my computer, the server, or another persons computer?