1、node调用exe文件

const exec = require('child_process').execFile;

const x = 'hello';
const y = 'world';
const file = './exe/test.exe';
exec(file, [x, y],(err, data) => {
    res.send(data);
})

2、python打包为exe文件

pyinstaller -F ./test.py
#!/usr/bin/env python
# _*_ coding:utf-8 _*_
import sys

word = ''
for i in range(len(sys.argv)):
    if i > 0:
        word = word + ' ' + sys.argv[i]

print(word)

Scroll to Top