Document your software at the minimum level: function, input, output, external resources needed, inline documentation. If the inline documentation adheres tp specific formats, automatic tools can convert it to a Library Reference in HTML or PDF. For Python, Sphinx can automatically generate documentation from the script code 3).
When your software can be used by others, make it Open Source. To this end we use GNU Public Licensing (GPLv3) . GPLv3 states that software may be used, modified, and integrated into other software as long as the developers are mentioned, and the new software is issued under GPL as well.
Check with our local system administrator (admin) if the above conditions have been met; s/he must know about the software and where it can be found.
Transfer the maintenance of the software to your supervisor when you leave.