I'm relatively new to programming, and I'm having some trouble with Python.
For reference, I've created a little python program that will load in a pdf, grab the relevant details, and upload it to my company's expense form. The program works well, but there's a problem: the code will only run on the pdf if I've hardcoded the location, like so:
receipt='C:\\Users\\\me\\Desktop\\expense app\\united receipt.pdf'
My goal is to make this an exe file that I can share with my co-workers, and have them right click on the pdf file and let the little macro run.
Here's the problem: I cannot figure out how to write the program so that the pdf is not hardcoded.
I already know how to make it into an exe file and put it into the context menu, but again, I don't know how to write it so that I can tell the program to pass the file I just selected.
Essentially, I want the code to say
receipt=file_you_just_clicked_on
Because it works just fine after the file is passed, but I don't know how to do that.
I've tried following the advice on this question: Run Python Script on Selected File
but either I'm completely misunderstanding what I'm supposed to be doing, or I've made the syntax all messed up.
Any help would be appreciated!
Please let me know if you need more context, this is my first time posting here.