There are times when it's not within practical feasibility to not hardcode plaintext passwords, especially if the project is small, and you don't have access to a password vault. When you're faced with a situation like this, it is best to approach the problem from the perspective of limiting the exposure.
One of the approaches that you can use is permissioning, assuming you trust the people who use the script. Since it's on Linux, you can chmod the file to 700, which means that only that particular user can read, write, or execute the file (assuming other users don't have root permissions, of course).
However, this approach can get tricky if the administrator turns rogue, or someone figures out a way to escalate their privileges. In such instances, it is better to increase the difficulty of finding such a password. A good way to do this might be to use Python Freeze or Pyinstaller to create a binary out of your script. Someone reversing the script can still get the password out, but it is a much harder effort, and hopefully discourages someone who is after the low hanging fruit (and potentially protects you from rogue admins). I wish I could go into details of how this could be done, but I've only seen people do it; I've never actually used these tools myself. But this gives you a chance to make a distributable binary that you can use, thus not having to deal with passing around a credential all over the place.