getQuery()如何在python中[关闭]
Posted
技术标签:
【中文标题】getQuery()如何在python中[关闭]【英文标题】:getQuery() How to in python [closed] 【发布时间】:2013-04-06 23:52:15 【问题描述】:我无法理解如何执行此操作。这样做的目的是对该函数进行不同的模块调用,使其返回正确的 url,然后将其下载并从中提取内容。
getQuery(location)
返回一个包含 GET 查询的 URL,用于从 wunderground.com 检索给定位置的天气。
例如,getQuery('Princeton, WV')
返回 URL
http://www.wunderground.com/cgi-bin/findweather/hdfForecast?query=Princeton%2C+WV
【问题讨论】:
你的问题不清楚。请添加一些关于什么是问题和什么不起作用的信息。 你用的是什么库?你想完成什么/什么不起作用? 给它一本字典?'getkey' : 'value'
Python retrieving information from the web for a weather widget 的可能重复项
来吧。现在您要针对作业中的每个功能提出一个单独的问题?
【参考方案1】:
def getQuery(location):
# return your root url plus the location encoded using quote_plus
# http://docs.python.org/2/library/urllib.html#urllib.quote_plus
pass
【讨论】:
以上是关于getQuery()如何在python中[关闭]的主要内容,如果未能解决你的问题,请参考以下文章
在 C# 中是不是有任何数据验证 nuget 库,如 python 的 voluptuous? [关闭]