Details:

I am having xxx.py file in B machine.
I trying to execute that xxx.python file from A machine by using python script.
Unless you have done something to specifically allow this, such as SSH into machine B first, you cannot do this.
That's a basic safety consideration. If any host A could execute any script on host B, it would be extremely easy to run malicious code on other machines.
How to run the python file in remote machine directory?