如果你需要编写与Python2和Python3兼容的代码,则可以使用以下导入
try: from urllib.parse import urlparseexcept importError: from urlparse import urlparse

如果你需要编写与Python2和Python3兼容的代码,则可以使用以下导入
try: from urllib.parse import urlparseexcept importError: from urlparse import urlparse