py build
This commit is contained in:
parent
a96ab06e31
commit
0bdd1b5a33
9 changed files with 37 additions and 0 deletions
5
C和C++扩展/pydext/pydext/build.bat
Normal file
5
C和C++扩展/pydext/pydext/build.bat
Normal file
|
@ -0,0 +1,5 @@
|
|||
cd %~dp0
|
||||
|
||||
python setup.py build
|
||||
|
||||
pause
|
BIN
C和C++扩展/pydext/pydext/build/lib.win32-3.5/pydext.cp35-win32.pyd
Normal file
BIN
C和C++扩展/pydext/pydext/build/lib.win32-3.5/pydext.cp35-win32.pyd
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
C和C++扩展/pydext/pydext/build/temp.win32-3.5/Release/pydext.obj
Normal file
BIN
C和C++扩展/pydext/pydext/build/temp.win32-3.5/Release/pydext.obj
Normal file
Binary file not shown.
8
C和C++扩展/pydext/pydext/setup.py
Normal file
8
C和C++扩展/pydext/pydext/setup.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
from distutils.core import setup, Extension
|
||||
|
||||
module = Extension('pydext', sources = ['pydext.c'])
|
||||
|
||||
setup (name = 'pydext',
|
||||
version = '1.0.0',
|
||||
description = 'This is pydext',
|
||||
ext_modules = [module])
|
22
C和C++扩展/pydext/pydext/test.py
Normal file
22
C和C++扩展/pydext/pydext/test.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
import sys
|
||||
|
||||
sys.path.insert(0,
|
||||
'./build/lib.{0}-{1}.{2}'.format(sys.platform, sys.version_info.major, sys.version_info.minor))
|
||||
|
||||
|
||||
import pydext
|
||||
|
||||
print(pydext)
|
||||
print(dir(pydext))
|
||||
|
||||
print(pydext.__author__)
|
||||
print(pydext.__mail__)
|
||||
|
||||
print(pydext.hello())
|
||||
|
||||
print(pydext.hello2('Irony'))
|
||||
|
||||
print(pydext.sum(1, 5))
|
||||
|
||||
# 结果变负数
|
||||
print(pydext.sum(1, 5, minus=True))
|
1
C和C++扩展/pydext/pydext/说明.txt
Normal file
1
C和C++扩展/pydext/pydext/说明.txt
Normal file
|
@ -0,0 +1 @@
|
|||
该目录下的setup.py是在vs编译环境的cmd下调用build.bat进行编译生成build文件夹。然后执行python test.py 对build文件夹中的pyd进行测试
|
1
C和C++扩展/pydext/说明.txt
Normal file
1
C和C++扩展/pydext/说明.txt
Normal file
|
@ -0,0 +1 @@
|
|||
该目录的test.py是用vs打开pydext.sln编译后生成的Release文件夹里的pyd进行测试
|
Loading…
Reference in a new issue