python beginner problem(?)
Alan Illeman
illemann at surfbest.net
Wed Feb 6 19:24:56 EST 2008
Win2k Pro - installed python: ok
Example 2.1 from DiveIntoPython tutorial copied
and pasted into "Pythonwin - Python IDE and GUI
Framework for Windows."
--------------------------------------------------------------
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)
--------------------------------------------------------------
produces..
=================================================
>>> C:\Python25\Lib\site-packages\pythonwin\pywin\mfc\object.py:
23: DeprecationWarning: raising a string exception is deprecated
raise win32ui.error, "The MFC object has died."
pwd=secret;database=master;uid=sa;server=mpilgrim
=================================================
DiveIntoPython example 2.1 result:
server=mpilgrim;uid=sa;database=master;pwd=secret
..which I realise is essentially the same (except for order).
I haven't ever (not that I remember) installed MFC.
Help!
tia
Alan
More information about the Python-list
mailing list