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())
原文:https://www.cnblogs.com/wgf4242/p/15115930.html