【题解】Databases and Visualization (peer-graded) (Using Databases with Python)

吐槽:这个作业花了我挺长时间,究其原因是没有好好看 README.txt 的内容,不过浪费的时间还是足以让我学到些。

题目:Retrieving GEOData

Download the code from http://www.py4e.com/code3/geodata.zip - then unzip the file and edit where.data to add an address nearby where you live - don't reveal where you live. Then run the geoload.py to lookup all of the entries in where.data (including the new one) and produce the geodata.sqlite. Then run geodump.py to read the database and produce where.js. You can run the programs and then scroll back to take your screen shots when the program finishes. Then open where.html to visualize the map. Take screen shots as described below. Make sure that your added location shows in all three of your screen shots.

This is a relatively simple assignment. Don't take off points for little mistakes. If they seem to have done the assignment give them full credit. Feel free to make suggestions if there are small mistakes. Please keep your comments positive and useful. If you do not take grading seriously, the instructors may delete your response and you will lose points.

我的解法:

只在 where.data 最下面添加了一个离自己最近的大学,然后运行 geoload.py 生成 geodta.sqlite,之后运行 geodump.py 生成 where.js,再用 where.html 生成最终图像就可以了。

我想说的:

1,第一次我看完是一头雾水,然后逛了逛week5的论坛,发现(https://www.coursera.org/learn/python-databases/discussions/weeks/5/threads/ztVbrqlWEeef3wq1mGCy6A)后,因为感觉英文文档太多了,只好做个伸手党寻找有关google maps api的信息(https://www.leadong.com/id56671.html),确实里面写的也很详细,申请到了API_KEY,但是在应用的时候还是出现了问题:This API project is not authorized to use this API.,使用真实的google api key我到现在还没有弄懂,如果有人知道怎么做的话,希望可以给我留言。

2,后来仔细看了一下那个论坛的内容,搜索了错误信息,发现助教给一些同学的回复是认真读README.txt,然后确实发现api_key = False是可以访问老师提供的网站也就是查询的一个子集,所以不需要更改geoload.py就可以成功生成咯。

补充:

2020/2/28:确实需要用vpn才能生成最后的图像,因为是用的google地图。为了这个作业还买了一个月vpn= =醉了。

2020/3/16:where.data 的打开方式选择记事本就可以进行编辑并保存。.data文件的详情可以看这个(https://zhidao.baidu.com/question/936404214430011172.html)。

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 16
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 16
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值