Jul-05-2019, 11:58 AM
Hi,
Line 31 is super wrong, using
Generally speaking, using
Other things:
Function names are written lowercase_with_underscore in Python, not camelCase or so.
When you start the number things like
Line 256 is not a valid Python expression, see above. Except this, the while-loop will never run ...
Line 38 should give you a NameError, as
What's the purpose of line 313? If you intend to stop the thread -> it will not.
Regards, noisefloor
Some of your other functions are too long, they do too much things at a time. I would recommend to break them down in smaller chunks of code.
Quote:But why necessarily 4 spaces and not one ?In Python, a couple of things are by convention, including things like indenting with four spaces (and always and only four spaces). Good Python programmers are picky about that - and that's correct. The general style guide for Python is the PEP 8, the holy grail of Python programming. Just read through it.
Line 31 is super wrong, using
global
like this is in a class is super wrong. Seems like there is a heavy lack on your side on understanding Python's classes and what attributes of classes are for. I would recommend to read through that in the official Python documentation.Generally speaking, using
global
is wrong in 99% of the cases, it's just to a poor design of the program. Avoid global, as it makes it very hard to track the state of your program.Other things:
Function names are written lowercase_with_underscore in Python, not camelCase or so.
When you start the number things like
printMessage_1
, printMessage_2
, it's a code smell and you most likely want to use a different structure. In your case, all the printMessages have highly redundant code. Use _1_ function only and pass the message to be print e.g. from a dict or a list storing the actual text.Line 256 is not a valid Python expression, see above. Except this, the while-loop will never run ...
Line 38 should give you a NameError, as
gpsp
is unknown in the scope of the method.What's the purpose of line 313? If you intend to stop the thread -> it will not.
Regards, noisefloor
Some of your other functions are too long, they do too much things at a time. I would recommend to break them down in smaller chunks of code.