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

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -