Python cleanups:
- Avoid reference to undefined name:
stderrdoes not exist,sys.stderrdoes - Use
print(...)instead of undefinedprintf(...) - Avoid redefinition of variable (
tx) in list comprehension - Remove unused variables and/or function calls
- Use
sys.exit(...)instead ofexit(...):exit(...)should not be used in programs