The name of my file is Step1.py and it is meant to open a page on google maps. I'm running El Capitan on a macbook air. It's saved in my home file and I gave it the permissions it needs (I think). Here's Step1.py:
#!
import pprint
import webbrowser
def launchweb(location):
web = 'https://www.google.com/maps/place/'
location = input('Gimmi Yo Adress: ')
rlocation = (location.replace(',', ''))
rlocation = rlocation.split()
for i in range(len(rlocation)):
if i != len(rlocation) - 1:
rlocation[i] = rlocation[i] + '+'
for i in rlocation:
web = web + i
return web
webbrowser.open(launchweb(12))
I entered chmod +x Step1.py
into the terminal, then I tried to run python ./Step1.py
It promted an address, and I entered one Gimmi Yo Adress: 1234 fake st, san fransisco, ca
Then it gave me this:
Traceback (most recent call last):
File "./Step1.py", line 16, in <module>
webbrowser.open(launchweb(12))
File "./Step1.py", line 7, in launchweb
location = input('Gimmi Yo Adress: ')
File "<string>", line 1
1234 fake st, san fransisco, ca
^
SyntaxError: invalid syntax
What is the proper syntax?