The python code

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)

i have typed the above code into gedit, when execute it, it showed an error, said: the line 4 have an illegal indent. but i fell there was’t an illegal indent,why?

I don’t see ANY indenting of your code. However maybe it’s been lost in your posting?

Python cares about indenting!