I'm sorry to say that it's really cluttered, as there are around 200 issues, which make the code barely readable.
You may want to use python black-formatter, pylint, pep8, and once the code is cleaner, everyone will be able to help you to maintain the script.
Haha no worry, i made this 10 years ago when there is no IDE I know. Plus I'm not developer, just junior system admin at the time. Of course the code is not clean.
Please do not leave this mess to the posterity :)
I'm sorry to say that it's really cluttered, as there are around 200 issues, which make the code barely readable.
You may want to use python black-formatter, pylint, pep8, and once the code is cleaner, everyone will be able to help you to maintain the script.
Right now, I don't dare to add a single line.