Basically, this script allows me to do a quick google map search if I press Win+R and type mapit (my script's name) and then the address (eg. mapit Market Street). Currently, the cmd stays open when there is or there is no exception raised. I would love for it to close if there is no errors or exception raised. The first script is my batch file while the second one is my python script. (ps. I'm a beginner)
@py C:\Users\<Name>\AppData\Local\Programs\Python\Python38-32\mypythonscripts\mapit.py %*
@pause
#! python3
import webbrowser, sys, pyperclip
Address = ' '.join(sys.argv[1:])
if len(sys.argv) <= 1:
raise Exception ('Please type in address or postal after \'mapit\'')
else:
webbrowser.open('https://www.google.com/maps/search/' + Address)