Python: Importing urllib.quote

前端 未结 5 586
广开言路
广开言路 2021-01-30 00:22

I would like to use urllib.quote(). But python (python3) is not finding the module. Suppose, I have this line of code:

print(urllib.quote(\"châteu\"         


        
5条回答
  •  北荒
    北荒 (楼主)
    2021-01-30 01:09

    Use six:

    from six.moves.urllib.parse import quote
    

    six will simplify compatibility problems between Python 2 and Python 3, such as different import paths.

提交回复
热议问题