There are other options than using the resistor.
In your python script, you could wait a sec after making your connection. Or a better option might be:
ser = serial.Serial('com5', 9600,timeout=1)
while 1:
ser.write(1)
a = ser.readline()
if (a == 1):
break
rest_of_your_code
I take it you can understand what that code is doing and write the appropriate code in your sketch to work with it. The jist of it is, it halts the python script until it is fully ready. Using a sleep command or some other option may not be long enough, or annoying long.
If you really don't care, you could do
ser = serial.Serial('com5', 9600,timeout=2)
ser.readline()
rest_of_your_code
Readline will block the serial port until it receives an eol or timeout. Basically the same thing as using sleep, but without having to include another library.