I'm working with Windows :
import os
import http.client as h
co = h.HTTPSConnection("www.google.com")
co.request("GET","/")
res = co.getresponse()
print(res.status,res.reason)
os.system("pause")
When I open the command line, all work perfectly : "200 OK"
But when I copy this in a file and save it, I have an error and the programm stop. I found a "solution", when I run my app, the folder "__pycache__" containing "http.cpython-34" is created. And I have to open the "http.cpython-34" file to see "200 OK" Is there another way to run correctly my programm without opening the "http.cpython-34" file ?
EDIT : I found the solution. My file was called http.py. But when I rename it, it work perfectly :)