home > rapid-tutorial > standard-input-stream

Placing input on the Standard Input Stream_

So you developed a Python program that reads data using input() or stdio.readString() and want to input a massive amount of data from a file called input.txt. How do you take the data from your file and place it on the standard input stream for your program?

Mac and Ubuntu: Terminal

python3 program.py < input.txt

If you have command line arguments c1, c2 and c3:

python3 program.py c1 c2 c3 < input.txt

Windows

Command Prompt

python program.py < input.txt

If you have command line arguments c1, c2 and c3:

python program.py c1 c2 c3 < input.txt

Powershell

Get-Content input.txt | python program.py

If you have command line arguments c1, c2 and c3:

Get-Content input.txt | python program.py c1 c2 c3

table of contents

Ready to join the movement?

Dive into our articles, explore our resources, and join the clan. Together, let's rewrite the rules of coding education and prove that learning can be fun, effective, and a little bit rebellious.

Subscribe to receive updates about new posts.