I\'m trying to get the filename thats given in the command line. For example:
python3 ritwc.py < DarkAndStormyNight.txt
I\'m
I don't think it's possible. As far as your python script is concerned it's writing to stdout. The fact that you are capturing what is written to stdout and writing it to file in your shell has nothing to do with the python script.