The only way this would be possible is by setting Wake on LAN , but you have the limitation that the computer you want to turn on the other you need to be in the same local network or open ports (port forwarding) so you can receive packets from outside (which can be dangerous).
In most operating systems it is something native that can be configured (although it also depends on the support of the network card). Then, you can use the wakeonlan
module (you can install it with pip using pip install wakeonlan
).
Using a MAC from the PC you want to turn on, you can do this to try to turn on the PC you want:
from wakeonlan import send_magic_packet
send_magic_packet('ff.ff.ff.ff.ff.ff')
You can also use IPs, you will find documentation here: link
Although there are other ways, they require additional or specific hardware. Wake on LAN is the most generic implementation out there.