(Sep-07-2018, 01:04 PM)ichabod801 Wrote: Also, if someone does give a file to process, nothing gets processed. Use the if/else just to get the file name, then do the processing after the if/else, not as part of the else clause. When you do print(f.read()), there is nothing left to read. So content=f.read() gets nothing. And item on line 17 needs to be items.
this helps, It really disturbed me. Thanks mate
(Sep-07-2018, 08:19 AM)buran Wrote: from line #5 I guess you want to use the second command line argument as the file to process. At the same time on line 7 the file name is hard coded and you always process firstfile.txt
that is located in the current working directory.
I was really misusing the sys.argv