Skip to content

Instantly share code, notes, and snippets.

@victory-sokolov
Created January 15, 2024 19:51
Show Gist options
  • Save victory-sokolov/0b7277904d6a153c11f04af0c0ea7618 to your computer and use it in GitHub Desktop.
Save victory-sokolov/0b7277904d6a153c11f04af0c0ea7618 to your computer and use it in GitHub Desktop.
JavaScript execute Flake8 formatter
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