Advertisement
A_GUES

HOW TO HTML RUN File .exe

Oct 11th, 2023
879
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.43 KB | None | 0 0
  1. <script>
  2. const { spawn } = require('child_process');
  3. const python = spawn('python', ['-c', "import subprocess; subprocess.run(['path_to_your_exe_file'], check=True)"]);
  4.  
  5. python.stdout.on('data', (data) => {
  6.     console.log(`stdout: ${data}`);
  7. });
  8.  
  9. python.stderr.on('data', (data) => {
  10.     console.error(`stderr: ${data}`);
  11. });
  12.  
  13. python.on('close', (code) => {
  14.     console.log(`child process exited with code ${code}`);
  15. });
  16. <script>
Advertisement
Comments
  • A_GUES
    1 year
    # text 0.13 KB | 0 0
    1. <script>
    2. const python = spawn('python', ['-c', 'import subprocess; subprocess.run(['path_to_your_exe_file'], check=True)']);
    3. </script>
Add Comment
Please, Sign In to add comment
Advertisement