diff --git a/DecryptPDF.py b/DecryptPDF.py index 5bba79b..8d2f2a8 100644 --- a/DecryptPDF.py +++ b/DecryptPDF.py @@ -6,6 +6,7 @@ import pikepdf, tkinter, os from tkinter import filedialog from pathlib import Path +import subprocess, platform print(' ***** NOTICE: MAKE SURE THAT THIS WINDOW IS ACTIVE BEFORE PRESSING ENTER *****') input("\n Let's select your PDF file!\n Press Enter :-)") @@ -35,4 +36,9 @@ input('\n\n Press Enter to exit the program and open the folder :-]') -os.startfile(destDir) +if platform.system() == "Windows": + os.startfile(destDir) +elif platform.system() == "Darwin": # macOS + subprocess.run(["open", destDir]) +else: # Linux + subprocess.run(["xdg-open", destDir])