Can not make DDE connection using python. win32ui appears not working -


i new python (version 2.7). have been using long time excel workbooks uses dde function capture "real-time market data" - served 1 market data provider ("matriks", if matters).

in bit simplify overall process flow, decided bypass excel workbook thing data capture, , instead, decided use python codes perform same task.

the problem that, 1) "error: server not created" when run code (provided below) using pythonwin.

2) , "importerror: must mfc application - try 'import win32ui' first" when run simple code using idle.

(and of course, downloaded , run win32ui.)

any appreciated.

# dde code # excel equivalent of code is: =mtx|data!eurusd.son import win32ui import dde  s=dde.createserver() s.create("mtx") c=dde.createconversation(s) c.connectto("data","son") c.connected() c.request("eurusd")  # returns # traceback (most recent call last): #  file "c:\iqtrader\_script\_obj\ddeclient.py", line 12, in <module> #   import dde # importerror: must mfc application - try 'import win32ui' first 

the issue resolved. basic reason error pywin module.

for facing same problem: 1.delete pythonwin , pywin32_system32 folderes entirely (presumably under c:\python27\lib\site-packages)

2.check pywin32 version; should 214 (not 218) using v2.7

3.download pywin32-214.win32-py2.7 appropriate resources (one this: http://sourceforge.net/projects/pywin32/files/pywin32/build%20214/ )

4.everything should fine.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -