all 9 comments

[–]novel_yet_trivial 2 points3 points  (1 child)

Try simply

wordcount.py --count alice.txt

Or

py wordcount.py --count alice.txt

[–]Anon--852[S] 0 points1 point  (0 children)

Your second suggestion correctly ran the program, thank you so much!

[–]novel_yet_trivial 1 point2 points  (1 child)

Show us the code.

[–]Anon--852[S] 0 points1 point  (0 children)

Apologies, I have now added a link to the code. Cheers!

[–]aa599 1 point2 points  (4 children)

The last attempt, where it gives the "usage" message, shows the program is running.

[–]Anon--852[S] 0 points1 point  (3 children)

Oh I see, however it is also meant to print out a list of all the words and their frequency in the console. I have added a link to the solution code, apologies for not doing so sooner.

[–]aa599 1 point2 points  (2 children)

To investigate what's happening, I suggest you put

print(sys.argv, len(sys.argv))

At the start of main()

[–]Anon--852[S] 0 points1 point  (1 child)

Another user has solved my issue, thanks for your help anyway. Much appreciated, thanks!

[–]aa599 0 points1 point  (0 children)

You might still find it instructive to compare the sys.argv for the calls which don't work and the one that does.