import os, sys, subprocess
env = os.environ.copy()
env['PYTHONSTACKSIZE'] = '8388608'
result = subprocess.run(
    [sys.executable, '-c', "import ctypes; k=ctypes.windll.kernel32; low=ctypes.c_void_p(); high=ctypes.c_void_p(); k.GetCurrentThreadStackLimits(ctypes.byref(low), ctypes.byref(high)); print('stack size: %.2f MB' % ((high.value-low.value)/1024/1024))"],
    env=env, capture_output=True, text=True
)
print('stdout:', result.stdout)
print('rc:', result.returncode)
