Python: Importing urllib.quote

前端 未结 5 568
广开言路
广开言路 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 00:56

    urllib went through some changes in Python3 and can now be imported from the parse submodule

    >>> from urllib.parse import quote  
    >>> quote('"')                      
    '%22'                               
    

提交回复
热议问题