Oct-13-2016, 12:27 AM
There are only two answers there, and neither supports using a class where a function will do.
A few recommendations to others using this thread for example code:
Don't overcomplicate code.
Different languages do things in ways that make sense for them, don't force all languages to use the some patterns.
A copy-pastable version of the spirit of this code is
A few recommendations to others using this thread for example code:
Don't overcomplicate code.
Different languages do things in ways that make sense for them, don't force all languages to use the some patterns.
A copy-pastable version of the spirit of this code is
def has_internet(): return '127.0.0.1' != socket.gethostbyname(socket.gethostname())