Same code used but still faceing a problem

When I use send_keys to send solution.py to the text editor, allignment is totally wrong as this is what I sent :-

and this is what i got :-

And when I try to send solution.cpp , a new tab opens with some website and codechef submission page is gone

I am not able top understand the problem.