How to run Python scripts with . txt entry in Windows?

Asked

Viewed 1,006 times

0

Hello, I’m a beginner here at Stack Overflow and in Python, and I need help to run a file of my class, whose entry is written a file. txt.

I know that in the Linux terminal, for Python 2.7, the command is more or less this:

python arquivo.py < entrada.txt

But and at the Windows command prompt, how do I pass this argument?

I’ve done a lot of research here on the site, but I only found questions about purely running the script, adding Python to the PATH, anyway. I couldn’t find anything related to files as arguments.

Thank you!

1 answer

0


I can’t test it here but I believe type entrada.txt | python arquivo.py should work on Windows. If you are using Python in Windows it might be interesting to install the Git for Windows, not by Git in itself but for winning a Bash and all its functionalities (and facilities).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.