//-------- INT RUN -----------------------
if (is(INITRUN)){
#ifdef _0MQ
if(!pyStart("../source/python/beta_sendK.py",1)) {
printf("\nError - Python won't start!");
return;
}
#endif
}
c) fce where I use
Code
//--------------------- 0MQ -> API -------------------------------------------------
void sendTo(string cPom){
#ifdef _0MQ
string xSend=strf("Main('%s')",cPom);
printf("\n Test: %s",xSend );
pyX(xSend);
int nRet=pyInt("retMsg");
if (nRet==1)
printf("\nNew predict send OK");
else if (nRet==2)
printf("\nNew predict is duplicate");
else if (nRet==0)
printf("\n0QM - undefined error");
else
printf("\n0QM - no send - will never seing");
#endif
}
d) error from PyError
Quote
Traceback (most recent call last): File "<string>", line 7, in <module> File "e:\conda\lib\site-packages\zmq\__init__.py", line 42, in <module> _load_libzmq() File "e:\conda\lib\site-packages\zmq\__init__.py", line 9, in _load_libzmq import sys, ctypes, platform, os File "e:\conda\lib\ctypes\__init__.py", line 7, in <module> from _ctypes import Union, Structure, Array ImportError: DLL load failed: %1 nen� platn� aplikace typu Win32. Traceback (most recent call last): File "<string>", line 1, in <module> NameError: name 'Main' is not defined SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function
source code python in att ( note: is not possible attach to script with extension .py )
maybe is a problem 64/32 bit installation of python, becouse manual say: Install Python 3.6.8 32 bit for Windows
But if I call it from Zorro is error again. PyError.txt output
Quote
Traceback (most recent call last): File "<string>", line 7, in <module> File "e:\tmp\zorroS\python\lib\site-packages\pyzmq-18.0.2-py3.6-win32.egg\zmq\__init__.py", line 47, in <module> from zmq import backend File "e:\tmp\zorroS\python\lib\site-packages\pyzmq-18.0.2-py3.6-win32.egg\zmq\backend\__init__.py", line 40, in <module> reraise(*exc_info) File "e:\tmp\zorroS\python\lib\site-packages\pyzmq-18.0.2-py3.6-win32.egg\zmq\utils\sixcerpt.py", line 34, in reraise raise value File "e:\tmp\zorroS\python\lib\site-packages\pyzmq-18.0.2-py3.6-win32.egg\zmq\backend\__init__.py", line 27, in <module> _ns = select_backend(first) File "e:\tmp\zorroS\python\lib\site-packages\pyzmq-18.0.2-py3.6-win32.egg\zmq\backend\select.py", line 35, in select_backend reraise(ImportError, ImportError("Importing %s failed with %s" % (name, e)), exc_info[2]) File "e:\tmp\zorroS\python\lib\site-packages\pyzmq-18.0.2-py3.6-win32.egg\zmq\utils\sixcerpt.py", line 33, in reraise raise value.with_traceback(tb) File "e:\tmp\zorroS\python\lib\site-packages\pyzmq-18.0.2-py3.6-win32.egg\zmq\backend\select.py", line 28, in select_backend mod = __import__(name, fromlist=public_api) File "e:\tmp\zorroS\python\lib\site-packages\pyzmq-18.0.2-py3.6-win32.egg\zmq\backend\cython\__init__.py", line 14, in <module> __all__.extend(submod.__all__) ImportError: Importing zmq.backend.cython failed with 'NoneType' object is not iterable Traceback (most recent call last): File "<string>", line 1, in <module> NameError: name 'Main' is not defined SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function SystemError: g:\a\3\s\objects\longobject.c:404: bad argument to internal function
Traceback (most recent call last): File "<string>", line 1, in <module> File "e:\tmp\zorroS\python\lib\site-packages\pyzmq-18.0.2-py3.6-win32.egg\zmq\__init__.py", line 47, in <module> from zmq import backend File "e:\tmp\zorroS\python\lib\site-packages\pyzmq-18.0.2-py3.6-win32.egg\zmq\backend\__init__.py", line 40, in <module> reraise(*exc_info) File "e:\tmp\zorroS\python\lib\site-packages\pyzmq-18.0.2-py3.6-win32.egg\zmq\utils\sixcerpt.py", line 34, in reraise raise value File "e:\tmp\zorroS\python\lib\site-packages\pyzmq-18.0.2-py3.6-win32.egg\zmq\backend\__init__.py", line 27, in <module> _ns = select_backend(first) File "e:\tmp\zorroS\python\lib\site-packages\pyzmq-18.0.2-py3.6-win32.egg\zmq\backend\select.py", line 28, in select_backend mod = __import__(name, fromlist=public_api) File "e:\tmp\zorroS\python\lib\site-packages\pyzmq-18.0.2-py3.6-win32.egg\zmq\backend\cython\__init__.py", line 6, in <module> from . import (constants, error, message, context, ImportError: Interpreter change detected - this module can only be loaded into one interpreter per process.
Alternatively to the Python bridge, Zorro can directly call the Python interpreter pythonw.exe and exchange data via file (see example). This method is slower, but works even when the used Python library does not support embedded Python.