Skip to content

Instantly share code, notes, and snippets.

@LinZap
Last active December 2, 2016 02:08
Show Gist options
  • Save LinZap/378d7e6c64d613da219518baf3e1f1ab to your computer and use it in GitHub Desktop.
Save LinZap/378d7e6c64d613da219518baf3e1f1ab to your computer and use it in GitHub Desktop.
Call other process use Node.js
const exec = require('child_process').exec
exec('py main.py', (error, stdout, stderr) => {
if(error)
console.log('print',stderr)
else
console.log('print',stdout)
})
import datetime
now = datetime.datetime.now()
print ('{0}/{1}/{2}'.format(now.year, now.month, now.day),end="",flush=True)
@LinZap
Copy link
Author

LinZap commented Jun 3, 2016

Call other process use Node.js

demo

node index.js

output

print 2016/6/3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment