Python Forum
testing for a network connection
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
testing for a network connection
#2
I don't know if this is possible in general, but it looks like bad design. Friendly python functions that receive a file with a write() method will usually accept any file-like object and will never try to guess what's beyond the write method. I think if you need the information, give the responsibility to the caller and change the signature to
def flood_with_spam(file, is_network):
    pass
Reply


Messages In This Thread
testing for a network connection - by Skaperen - Jun-16-2020, 01:02 AM
RE: testing for a network connection - by Gribouillis - Jun-16-2020, 04:31 PM
RE: testing for a network connection - by DeaD_EyE - Jun-16-2020, 05:12 PM
RE: testing for a network connection - by Skaperen - Jun-16-2020, 10:34 PM
RE: testing for a network connection - by DeaD_EyE - Jun-17-2020, 09:32 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020