I am using python on mac and would like to open a pdf file that is present in different directory than the directory my main python code is running. I tried different options but there is always an error saying file doesn't exist even when the file is present or [Error no. 2] file cannot be opened. Here is the code that I use:
helpFile = os.path.abspath('~/help/help.pdf')
self.help_btn = tk.Button(self.help_frm, text="Help!", width=8, command = lambda: os.system("open "+helpFile))
could some one help please.