【发布时间】:2017-02-14 04:10:48
【问题描述】:
我有这个代码:
import ctypes
lib = ctypes.WinDLL('python33.dll')
print(lib['PyRun_SimpleString'])
func = lib['PyRun_SimpleString']
func.argtypes = [ctypes.c_char_p]
func.restype = ctypes.c_int
arg = "print(':P')"
arg = arg.encode('utf-8')
func(arg)
结果:
OSError: exception: access violation reading 0x00000004
使用 sublime text 运行(python3.3 嵌入)
【问题讨论】:
标签: python dll sublimetext3 ctypes