import webbrowser
import os
try:
response=os.system('start notepad++.exe')
except OSError:
webbrowser.open("https://www.rollapp.com/launch/notepad++")
If notepad++ is installed in system then it should open, otherwise the online notepad++ should launch.
However, try
and except
are not working in that way.
How does it work?