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 :

1 Like

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]

i think the link in dead.

url is not correct…

Try the following:

cat input_file.txt | python