text="我爱自然语言处理。"

text=str(text)

#text=urllib.quote(text)

text=urllib.parse.quote(text)


def test1():

pattern = 'ws'

url = 'http://ltpapi.voicecloud.cn/analysis/?' \

'api_key=youkey' \

'&text='+text+\

'&pattern='+pattern+\

'&format=plain';

response = request.urlopen(url)

content = response.read().decode('utf-8')

print(content)




test1()

python3没有了urllib.quote(text)

需使用urllib.parse.quote(text)


相关文章:

  • 2022-12-23
  • 2022-02-12
  • 2021-10-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-25
  • 2022-02-15
猜你喜欢
  • 2021-12-26
  • 2022-01-19
  • 2022-12-23
  • 2021-07-19
  • 2021-12-13
  • 2022-12-23
相关资源
相似解决方案