I use my computer to communicate with a piece of hardware via ethernet. To communicate with this device I set my ip to 192 168 0 11, subnet mask to 255 255 255 0, and defaul
You can use the subprocess module to start
netsh interface ip set address [params]
Start this from the commandline (without[params]) to get some help how to use it. Then you can do
import subprocess
subprocess.call("netsh interface ip set address ....".split())
Update:
For those who's too busy to rtfm,
netsh interface ip set address lan static 192.168.0.100 255.255.255.0
netsh interface ip set address lan dhcp
here lan is the name of the network interface to configure, 192.168.0.100 is ip address, 255.255.255.0 is network mask. The first command sets static address, the second reverts to dhcp.