I am trying to follow the tutorial found here: http://www.diveintopython.net/getting_to_know_python/index.html
Here's what I am doing ...
$ cat odbchelper.py
def buildConnectionString(params):
"""Build a connection string from a dictionary of parameters.
Returns string."""
return ";".join(["%s=%s" % (k, v) for k, v in params.items()])
if __name__ == "__main__":
myParams = {"server":"mpilgrim", \
"database":"master", \
"uid":"sa", \
"pwd":"secret" \
}
print buildConnectionString(myParams)
... and when I run the above script I get this output ...
$ python3 odbchelper.py
File "odbchelper.py", line 13
print buildConnectionString(myParams)
^
SyntaxError: invalid syntax
... I am not sure what is wrong here. Is it python3 thing?
Thanks