Redirecting stdin and stdout within idle-python3 -
i have python3 program can execute terminal typing:
python3 prog.py < inp_file > out_file i execute program within idle shell without change, did not find how tell idle files use.
the idle shell not command line terminal. imitates standard interactive python shell. cannot use terminal-specific syntax either. should able equivalent with
import subprocess subprocess.run('python3 prog.py', stdin=infile, stdout=outfile) the files should open files, not file names. read subprocess doc.
Comments
Post a Comment