Can i command to server Minecraft with python?

I’ve searched such as this question a lot
but I didn’t get a satisfactory answer

I want to change weather in own server according to temperature sensor value.
But I couldn’t control a command with Python in Minecraft (for example, /weather, /kill)
So, How can i control that? or Can’t?

If there is a way, is there a link related to it?

Thanks