랭귀지/python
python 파이썬 인터넷 - 네트워크 연결 확인
유키공
2019. 1. 26. 10:00
python 파이썬 인터넷 - 네트워크 연결 확인하는 방법
#-*- coding: utf-8 -*-
'''
Created on 2019. 01. 25.
@author: bhm
'''
import socket
ipaddress=socket.gethostbyname(socket.gethostname())
if ipaddress=="127.0.0.1":
print("You are not connected to the internet!")
else:
print("You are connected to the internet with the IP address of "+ ipaddress )