Disconnecting from WiFi using python (Windows)
<p>I can connect to a WiFi network using: </p>

<pre><code>process = subprocess.Popen(
    'netsh wlan connect {0}'.format(wifi_network),
    shell = True,
    stdout = subprocess.PIPE, 
    stderr = subprocess.PIPE)
stdout, stderr = process.communicate()
</code></pre>

<p>I was wondering if there was a similar way to disconnect from a WiFi network? Either disconnecting from all WiFi networks or disconnecting from a specific network (given a name) would be fine. </p>

<p>Look at <strong>"netsh wlan disconnect"</strong>: <a href="https://technet.microsoft.com/en-us/library/cc755301(v=ws.10).aspx#bkmk_wlanDisConn" rel="nofollow">Netsh Commands for Wireless Local Area Network</a></p>

python subprocess wifi