[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

python beginner problem(?

Alan Illeman

2/7/2008 12:25:00 AM

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


4 Answers

Steve Holden

2/7/2008 2:37:00 AM

0

Steve Holden wrote:
> Alan Illeman wrote:
>> Win2k Pro - installed python: ok
>>
[...]
>> =================================================
>>>>> 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!
>>
[...]
> I am hugely surprised to find that PythonWin apparently raises string
> exceptions: this is an old programming technique, which should have been
> removed from anything designed to run on Python 2.5. That is why you see
> the message: it's only a warning, so you can ignore it. I am copying
> Mark on this message in case he's unaware of the issue.
[...]

In a private reply Mark Hammond says he will fix this in the next
release - thanks for the report!

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.hold...

Steve Holden

2/7/2008 2:08:00 PM

0

Alan Illeman wrote:
> "Steve Holden" <steve@holdenweb.com> wrote in message
> news:mailman.424.1202352008.9267.python-list@python.org...
>> Steve Holden wrote:
>>> Alan Illeman wrote:
>>>> Win2k Pro - installed python: ok
>>>>
>> [...]
>>>> =================================================
>>>>>>> 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!
>>>>
>> [...]
>>> I am hugely surprised to find that PythonWin apparently raises string
>>> exceptions: this is an old programming technique, which should have been
>>> removed from anything designed to run on Python 2.5. That is why you see
>>> the message: it's only a warning, so you can ignore it. I am copying
>>> Mark on this message in case he's unaware of the issue.
>> [...]
>>
>> In a private reply Mark Hammond says he will fix this in the next
>> release - thanks for the report!
>>
>> regards
>> Steve
>> --
>> Steve Holden +1 571 484 6266 +1 800 494 3119
>> Holden Web LLC http://www.hold...
>
> Thanks Steve for both your replies.
> Was (or is) python a piggyback for MFC?
>
>
You are supposed to be able to access the MFC classes through PythonWin,
but I have never personally bothered because MFC is too horrible to
tangle with.

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.hold...

Alan Illeman

2/7/2008 2:39:00 PM

0

"Steve Holden" <steve@holdenweb.com> wrote in message
news:mailman.424.1202352008.9267.python-list@python.org...
> Steve Holden wrote:
> > Alan Illeman wrote:
> >> Win2k Pro - installed python: ok
> >>
> [...]
> >> =================================================
> >>>>> 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!
> >>
> [...]
> > I am hugely surprised to find that PythonWin apparently raises string
> > exceptions: this is an old programming technique, which should have been
> > removed from anything designed to run on Python 2.5. That is why you see
> > the message: it's only a warning, so you can ignore it. I am copying
> > Mark on this message in case he's unaware of the issue.
> [...]
>
> In a private reply Mark Hammond says he will fix this in the next
> release - thanks for the report!
>
> regards
> Steve
> --
> Steve Holden +1 571 484 6266 +1 800 494 3119
> Holden Web LLC http://www.hold...

Thanks Steve for both your replies.
Was (or is) python a piggyback for MFC?


Alan Illeman

2/7/2008 6:13:00 PM

0

"Steve Holden" <steve@holdenweb.com> wrote in message
news:mailman.451.1202393411.9267.python-list@python.org...
> Alan Illeman wrote:
> >
> > Thanks Steve for both your replies.
> > Was (or is) python a piggyback for MFC?
> >
> >
> You are supposed to be able to access the MFC classes through PythonWin,
> but I have never personally bothered because MFC is too horrible to
> tangle with.
>
> regards
> Steve

That's a relief; I always hated MFC. Thanks.