Python3 调用c中srand 随机数
import sys
from ctypes import *
if sys.platform == 'win32':
print(cdll.msvcrt.srand(1))
print(cdll.msvcrt.rand())
if sys.platform == 'linux':
libc = cdll.LoadLibrary("/lib/x86_64-linux-gnu/libc.so.6")
libc.srand(1)
print(libc.rand())