input in python

How can we input data in python like that of ideone. like i have input stored in file and i want to give whole input at once through stdin.

1 Like

Check for you answer :


let the file be “fname.txt” and python code be “”. Put them in the same folder. Then use terminal in ubuntuor command prompt in windows to go to the folder where they are and use python < fname.txt. You can also re-direct the output it to another text file by doing python < fname.txt > op.txt

4 Likes…/Tutorial-ReadingWritingData.pdf‎

Try to checkout the this link]

Try the following:

cat input_file.txt | python

i think the link in dead.

url is not correct…