I try to test my Java class using python, i use suproccess in a "for loop"
>>> import subprocess
>>> for x in range(1, 6):
... subprocess.call(["java", "Watermelon"])
...
so when the Watermelon is executing waiting for input...
public class Watermelon{
public static void main(String[]args){
Scanner sc = new Scanner(System.in);
int w = sc.nextInt();
and i have to input the "value" and press ENTER to Watermelon get the "value" and the loop from python continues and input the "value" again and ... to the end.
Can you help me to use "x" in python loop like the "value" to java class...
Thanks for your help and excuse me by my English.