equal
deleted
inserted
replaced
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
|
2 <Python xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="py_ext_xsd.xsd"> |
|
3 <![CDATA[import time,sys,ctypes |
|
4 Python_to_C_Call = PLCBinary.Python_to_C_Call |
|
5 Python_to_C_Call.restype = ctypes.c_int |
|
6 Python_to_C_Call.argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)] |
|
7 |
|
8 def MyPythonFunc(arg): |
|
9 i = ctypes.c_int() |
|
10 if(Python_to_C_Call(arg, i)): |
|
11 res = i.value |
|
12 print "toC:", arg, "from C:", res, "FBID:", FBID |
|
13 else: |
|
14 print "Failed Python_to_C_Call failed" |
|
15 res = None |
|
16 sys.stdout.flush() |
|
17 return res |
|
18 |
|
19 async_error_test_code = """ |
|
20 def badaboom(): |
|
21 tuple()[0] |
|
22 |
|
23 import wx |
|
24 def badaboomwx(): |
|
25 wx.CallAfter(badaboom) |
|
26 |
|
27 from threading import Timer |
|
28 a = Timer(3, badaboom) |
|
29 a.start() |
|
30 |
|
31 b = Timer(6, badaboomwx) |
|
32 b.start() |
|
33 """ |
|
34 ]]> |
|
35 </Python> |
|