I'm 14, pardon my Python knowlege. I'm trying to make this program that will only run while I'm at school (on the school's Wifi) using an if/else statement like this:
if ontheschoolwifi:
Keep running the program
else:
close the program because im not at school and wont need it
I'd like to know how to let python know how to get what wifi it is connected to. Thank you, in advance, for your help :)
Who-is-on-my-wifi is a Python3 cli project that allows you to see who is stealing your WiFI network, scan your WiFI and show you how many devices are connected. Software can be installed on any Windows and Linux device (Mac not verified).
You can check how many personal devices are connected to your Wi-Fi network in the Google Home app or the Google Wifi app.
request def connect(host='http://google.com'): try: urllib. request. urlopen(host) #Python 3. x return True except: return False # test print( "connected" if connect() else "no internet!" )
Use the create_connection() method to establish the connection. Connect to the host and tell whether the host is actually reachable or not. Create_connection only connects to TCS sockets. If connection is established then return True otherwise return False.
import subprocess
if "SchoolWifiName" in subprocess.check_output("netsh wlan show interfaces"):
print "I am on school wifi!"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With