0

This is the way that the program will be run: Python LinkState < test1.txt Linkstate is the name of the .py file. test1.txt is the name of the text file being accepted in the python code. So my question is how should I handle the txt file in my code for this to work?

I assume this is a Windows format. I am a mac user, I don't have bootcamp installed and I don't want it. Is there anyway I can test on my mac to make sure this will work in the windows environment?

Thanks

EllenS
  • 23
  • 8

1 Answers1

1

Actually, the way the command is setup is using soemthing called IO redirection which is a construct that is more inline with Unix-like systems than Windows for reasons I won't get into here (I would defer to this great answer here for a detailed comparison. Also google 'Everything is a file Unix' for more concise summary).

Since macOS is a Unix-like system, IO redirection is a very natural thing to do. This answer here gives a concise answer to deal with that. Also refer to this SO answer for processing stdin.

xinkecf35
  • 328
  • 1
  • 10