1

I want to run a simple python script 100 times in parallel using bash. If I run the python scrips serial everthing is fine, but if I run them in parallel I get the error

stdin is not a tty Presumably because the same python file gets opened multiple times?

Here's the bash file

#!/bin/bash

for i in {1..5}; do
        winpty python test.py &
done

If I remove the & sign everything works fine (serial) but not if I run it in parallel. The Python file is litterally just 1+1

PS: I run python with winpty python and not the usual python because I run it from the git-bash console and that thing has issues... But again, I don't think this is where the issue comes from, because running everything in serial works fine...

tripleee
  • 175,061
  • 34
  • 275
  • 318
Jürg W. Spaak
  • 2,057
  • 1
  • 15
  • 34

1 Answers1

0

I don't have winpty to test following script, but try :

#!/bin/bash

for i in {1..5}; do
        winpty python test.py < /dev/tty > /dev/tty 2>&1 &
done
Philippe
  • 20,025
  • 2
  • 23
  • 32