A proxy when done right does not need you to change code. You use the same code but point your requests to the proxy IP address and port number. It's that simple.
I tried using an HTTP proxy with a Python SMTP script I have, but this just timedout. I then found out that there's something called a SMTP proxy, what's the difference between these two, and how do I use a SMTP proxy in my python script?
Here's my python code:
s = smtplib.SMTP(host,port)