Dec-28-2017, 07:48 AM
Obviously I'm not able to try, but in order to debug I would remove the try/except thus it will show what the actual error is. i.e. Connection time out is something you print, but because you have all-catching except it masks what the actual error is - i.e. it could be simple syntax error for example. Using all-catching except is generally considered bad practice and only acceptable if you actually print what the error description is
also line will have '\n' at the end, so you may need to strip this before supply line as argument hostname
also line will have '\n' at the end, so you may need to strip this before supply line as argument hostname