Last active
December 2, 2016 02:08
-
-
Save LinZap/378d7e6c64d613da219518baf3e1f1ab to your computer and use it in GitHub Desktop.
Call other process use Node.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const exec = require('child_process').exec | |
exec('py main.py', (error, stdout, stderr) => { | |
if(error) | |
console.log('print',stderr) | |
else | |
console.log('print',stdout) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
now = datetime.datetime.now() | |
print ('{0}/{1}/{2}'.format(now.year, now.month, now.day),end="",flush=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Call other process use Node.js
demo
output