Created
January 15, 2024 19:51
-
-
Save victory-sokolov/0b7277904d6a153c11f04af0c0ea7618 to your computer and use it in GitHub Desktop.
JavaScript execute Flake8 formatter
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'); | |
const pythonCode = `def hello_world(): | |
print("Hello, World!")`; | |
exec(`echo "${pythonCode}" | python -m flake8 -`, (error, stdout, stderr) => { | |
if (error) { | |
console.error(`exec error: ${error}`); | |
return; | |
} | |
console.log(`stdout: ${stdout}`); | |
console.error(`stderr: ${stderr}`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment