examples: detect windows and use correct file in the call_v_from_python example (#13114)

pull/13117/head
Charles WANG 2022-01-10 15:11:54 +08:00 committed by GitHub
parent 5e85d4cb39
commit 7f1cc44b04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -1,4 +1,8 @@
from ctypes import *
import os
so_file="./test.so"
if os.name=="nt":
so_file="./test.dll"
my_functions = CDLL(so_file)
print(my_functions.square(10))