On Saturday, June 10, 2017 at 3:23:03 PM UTC+4:30, Thomas Jollans wrote: > On 10/06/17 11:33, Mohammad Ghasemi wrote: > > Hi. > > I want to convert a python 2 code to python 3 code and I have a problem > > with that. > > I've asked my question on stackoverflow and never received an answer. > > Where can I get an answer? > > > > https://stackoverflow.com/questions/44411439/httplib-http-class-for-python3 > > > > You asked this only two days ago. "never received an answer" is a strong > statement considering. > > > > As you obviously know, httplib as has renamed http.client. > > > [...] from http.client import HTTP will not work. > > According to the documentation > <https://docs.python.org/2/library/httplib.html>, the HTTP class is > ancient and "should not be used in new code". It makes sense that it > would have been removed in Python 3.0 - looks like you should just use > HTTPConnection. > > More generally: > > If you say something does not work, please provide a complete minimal > working example with an error message. Otherwise there is no way anybody > can know what it going wrong. > > You provided example code (great!) but it's not complete: you are using > things without importing them, and it doesn't look like your code would > actually do much of anything if the relevant modules *were* imported. > > > -- Thomas
As you said, HTTP Class should no longer be used. You're right. >From now on, I'll try to ask my questions more readable and understandable. Thank you, Thomas. -- https://mail.python.org/mailman/listinfo/python-list