Apr-18-2019, 06:32 PM
s is defined on line 12, and it cease to exist once you exit the "with" statement. Moreover, you need to fix the indentation of lines 12-14, because they currently are at the same indentation level as the __init__ function, instead of belonging to "def __init__". I'm not really familiar with sockets, but since you need an http request, perhaps the request library might be easier to start with.