just starting using UNIX this semester to move programs to repositories and I am curious as to how to prep my file to be run in that enviroment...
Heres my code:
def main(file):
cTest = 0
words = 0
lines = 0
chars = 0
for l in open(str(file)):
linewords = l.split()
for w in l:
chars += 1
lines += 1
words += len(linewords)
print("Lines: " + str(lines))
print("Characters: " + str(chars))
print("Words: " + str(words))
In terms of a functionality standpoint it works fine when pointed properly on my own system, but now that is is on UNIX I am being told to run it like this....
python3 wc.py < file.txt
how do I prepare the file so that when executed in this environment it will take the text properly?