- 透過 os package, 可以設定 environment variable 與執行的 binary
- Sample: wrapper_call_executable
import sys import os lib_path = sys.argv[1] exe_path = sys.argv[2] bin_parameters = sys.argv[3] os.environ['LD_LIBRARY_PATH'] = lib_path os.system(exe_path + " " + bin_parameters)
沒有留言:
張貼留言