In my python script - youdao.py, in order to be compatible with python2 and python3, I import urlopen like this style:
try:
# compatible for python2
from urllib import urlencode
from urllib2 import urlopen
except ImportError:
# compatible for python3
from urllib.parse import urlencode
from urllib.request import urlopen
See details in https://github.com/MintCN/youdao-python/blob/master/youdao_simple/youdao.py#L22
When you use pylint youdao.py
, you will see ungrouped-imports warning
, how do I modify code to remove this warning?