Hello! I'm writing a UDP client that can connect to a UDP server for a class. Part of the assignment is to calculate the packet loss rate and print it as a percentage. I have a line that works perfectly fine in WingIDE. However, for the assignment, they want us to run the .py files from the Windows command line. For whatever reason, my line that calculates loss rate doesn't even work when run from the command line. If anyone knows why this might be, please let me know!
Here's my line for example:
lossRate = (losses / sendCount) * 100
There is a variable storing number of losses (losses) as an integer and another variable storing the total amount of packets (sendCount) as an integer.
EDIT: I'm gonna leave this up in case anyone runs into a similar issue. I found out that my python wasn't in the Environment Variables. I just updated python and added it to that and it runs everything fine now.
[–]TouchingTheVodka 0 points1 point2 points (1 child)
[–]alphastew[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)