PDA

View Full Version : Python Help


AtomSlap
01-06-2007, 11:31 PM
def buildConnectionString(params):
"""Build a connection string from dictionary of parameters

Returns string."""
return ";".join(["%s=%s" % (k, v) for k, v in params.items()l)
if_name_== "_main_":
myParams = {"server":"mpilgrim", \
"database":"master", \
"uid":"sa:, \
"pwd":"secret" \
print buildConnectionString(myParams)

When I run this code in PythonWin (ActiveState ActivePython 2.4) it says:

"Error - Could not save file"
"[Errno2] No such file or directory:" "

Anyways, I get what it means by No such file or directory, but why is it doing this?

Sorry if this is an idiotic question. I'm new to this -.-

Got to start somewhere I s'pose.