c 扩展 Python 的问题

1 view
Skip to first unread message

王虎

unread,
Nov 8, 2009, 9:59:50 PM11/8/09
to python-cn
hi, all :

我自己写了一个 dll,现在要把这个 dll 放到哪里,才能 import 进来呢?

smallfish

unread,
Nov 8, 2009, 10:00:50 PM11/8/09
to pyth...@googlegroups.com

xyshen

unread,
Nov 8, 2009, 10:03:01 PM11/8/09
to pyth...@googlegroups.com
py文件和dll文件放在一个目录下就可以了

import os
from ctypes import *

old_path = os.getcwd()
os.chdir(os.path.dirname(os.path.realpath(__file__)))
smb_dll = WinDLL("etsmbw32.dll")
os.chdir(old_path)


2009/11/9 王虎 <ghost...@gmail.com>

小人物小人物

unread,
Nov 8, 2009, 10:05:44 PM11/8/09
to pyth...@googlegroups.com
\DLLs 

2009/11/9 smallfish <smallf...@gmail.com>
Reply all
Reply to author
Forward
0 new messages