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

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.