0

I have a program that when I run in shell, it asks for input from the user. When I run it as follows with subprocess.Popen, it does not get into the part of the program where it asks for input and it just finishes. How could I change that?

cmd = ["./pairwise", "-seq", sites, "-loc", locs, "-lk", "species_genotypenew_lk.txt", "-prefix", ldhat_out]
subprocess.Popen(cmd)

Thanks!

Homap
  • 1,990
  • 3
  • 21
  • 31

1 Answers1

1

if pairwise is reads from stdin and writes to stdout

subprocess.Popen(cmd).communicate()

should do it.

Diego Torres Milano
  • 61,192
  • 8
  • 106
  • 129