# python final **Repository Path**: yanglelin/python-final ## Basic Information - **Project Name**: python final - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-01-24 - **Last Updated**: 2021-01-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # python final ## 写在开头: ## 出现该页面 ## 评分同学可通过注册账号,登录使用天气查询功能 ### [项目地址](http://lokkk.pythonanywhere.com/) ![登录页面.jpg](https://gitee.com/yanglelin/python-final/raw/master/images/%E7%99%BB%E5%BD%95%E9%A1%B5%E9%9D%A2.jpg) --- ## 一、项目名称:看!天气 本python项目的价值主张宣言是,为用户提供快捷便利查询天气的途径。本网页界面整洁,用户使用感良好。登陆后查询天气除了有温度显示,还有风速的显示,也有小图标进行图形显示,更加生动明白。 ![结构图.jpg](https://gitee.com/yanglelin/python-final/raw/master/images/%E7%BB%93%E6%9E%84%E5%9B%BE.jpg) ## 二、问题表述 本python项目主要通过网络爬虫抓取网络上的天气预报信息,为用户提供近五日广州的天气预报信息。 | 序号 | 用户身份 | 用户需求 | 解决方案 | | --- | --- | --- | --- | | 1 | 家庭主妇 | 小孩上幼儿园,该主妇需要看天气预报,准备好第二天的衣服让小孩带回学校替换。 | 简单明了的天气预报系统可以让该主妇看到近五日的天气。 | | 2 | 社畜 | 每天上班前需要看天气预报,预测自己需不需要带雨具上班。 | 简单明了的天气预报系统可以让该社畜看到天气状况,温度,是否下雨以及风速。 | | 3 | 在广州读书的普通大学生 | 放假时需要看天气预报,根据温度进行衣服搭配,预测自己是否需要雨具。 | 简单明了的天气预报系统可以让该大学生看到天气状况,温度,是否下雨以及风速。可以让该大学生更方便地进行衣服搭配。 | ## 三、解决方案表述 本次项目规划是通过python技术来获取气象台网站的广州近5日的天气,以python的网络爬虫技术为主,通过爬虫技术为主,数据库存储技术为辅。将抓取得信息存取在数据库当中,最后再通过python集合取值的方法,将日期,温度,详细,云,图片等返回至页面。本次项目涉及多个python知识点具体见下。 1. python的数据爬虫抓网页进行正则解析,可以参考 1. 数据库的存储与使用,本次项目共涉及了天气数据的存储,用户信息的存储,并且能成功的将天气数据成功调出,并以可视化的信息返回给用户。 1. 本次项目有用到 | 序号 | 知识点 | | --- | --- | | 1 | if 判断语句 | | 2 | for 循环遍历使用 | | 3 | 数据库语句 | | 4 | 字符串的代替 | | 5 | 函数使用 | | 6 | 字符串方法 | 4. 本次项目参考一下的文档 [[https://blog.csdn.net/opzoonzhuzhengke/article/details/7078342](https://blog.csdn.net/opzoonzhuzhengke/article/details/7078342)] ([https://blog.csdn.net/opzoonzhuzhengke/article/details/7078342](https://blog.csdn.net/opzoonzhuzhengke/article/details/7078342)),[[https://blog.csdn.net/qq_40574584/article/details/79064503](https://blog.csdn.net/qq_40574584/article/details/79064503)]([https://blog.csdn.net/qq_40574584/article/details/79064503](https://blog.csdn.net/qq_40574584/article/details/79064503)),[[https://blog.csdn.net/hallomrzhang/article/details/85010014](https://blog.csdn.net/hallomrzhang/article/details/85010014)]([https://blog.csdn.net/hallomrzhang/article/details/85010014](https://blog.csdn.net/hallomrzhang/article/details/85010014)) ## ## 四、编程功能的基本描述 | 知识点 | 项目比重 | 自学时长 | | --- | --- | --- | | python网络爬虫 | 30% | 10课时 | | 数据库的使用 | 40% | 4课时 | | pythonanywhere部署 | 10% | 1课时 | | python函数 遍历 if判断 字符串方法 | 15% | 5个课时 | | html5 css | 5% | 5个课时 | 可参考以下文档 1.《[数据库的基础学习](https://blog.csdn.net/qq_38409944/article/details/78952051)》 2.《[如何0基础自学mysql](https://www.zhihu.com/question/34840297)》 3.《[爬虫抓取数据的简单实现](https://www.cnblogs.com/ao-xiang/p/6601228.html)》 4.《[python爬虫的入门课程](http://c.biancheng.net/view/2011.html)》 5.《[html 菜鸟教程](https://www.runoob.com/html/html-tutorial.html)》 6.《[css 菜鸟教程](https://www.runoob.com/html/html-tutorial.html)》 7《[html W3c school](https://www.w3cschool.cn/html/)》 8《[python3 菜鸟教程](https://www.runoob.com/?s=python3)》 ## 五、pythonanywhere部署心得 1. 进入pythonanywhere官网,进行注册免费账号,在注册完成后,会显示注册失败,这时对pythonanywhere进行反馈,并输入自己的邮箱,等待pythonanywhere的反馈邮件进行激活。 1. 因为pythonanywhere的python版本是2.7,但我们的python版本是python3,所以需要在pythonamywhere创造新环境具体可以参考《[手把手pythonanywhere上部署flask](https://www.yuque.com/lokkk/mzsyqp/yowp7q/edit)》,因为我的作品需要用到mysql,所以需要pip install mysql 3. 先创建一个文件夹,压缩自己的本地项目文件,以zip形式上传到pythonanywhere,重新进入consoles并解压zip,解压后的文件放入刚刚的文件夹中 3. add a new web app 选择对应自己本地版本的flask,设置路径。 3. 返回SWGI configuration file修改相应路径,然后进入后将最后一行代码改为-from app import app as application,最后保存。 3. 点击reload按钮,部署完成。 3. ![数据流程图.png](https://gitee.com/yanglelin/python-final/raw/master/images/%E6%95%B0%E6%8D%AE%E6%B5%81%E7%A8%8B%E5%9B%BE.png) ## 六、学习/实践心得总结及感谢 学习心得: 本项目具有一定的挑战性,首先是构思做什么主题。考虑到广州天气变化无常,常常经历一个星期经历春夏秋冬,所以做一个天气预报系统是合理的。许老师也在课堂上教过天气预报的相关知识与如何制作登陆系统。本项目代码较多的部分是登录系统,用户可以通过注册登录,更为规范 感谢: 1、感谢两位老师的辛勤付出,许老师在API课上也会讲述python知识,将两堂课的知识有效地结合起来。 2、感谢所有给予我帮助与指导的同学、学长学姐,当我遇到不懂不理解的地方,他们都会跟我再次讲述知识点。 3.感谢参与本项目评分的同学 ,感谢他们在此项目上的思考和指导,感谢他们给出合理的分数。 4.感谢感谢上述所引用的所有文档及作者,下面再一次列举 | 序号 | 参考的文档 | 序号 | 参考的文档 | | --- | --- | --- | --- | | 1 | [学习链接1](https://blog.csdn.net/opzoonzhuzhengke/article/details/7078342) | 2 | [学习链接2]() | | 3 | [学习链接3](https://blog.csdn.net/qq_40574584/article/details/79064503) | 4 | [学习链接4](https://blog.csdn.net/qq_40574584/article/details/79064503) | | 5 | [学习链接5](https://blog.csdn.net/hallomrzhang/article/details/85010014) | 6 | [学习链接6](https://blog.csdn.net/hallomrzhang/article/details/85010014) | | 7 | [数据库的基础学习](https://blog.csdn.net/qq_38409944/article/details/78952051) | 8 | [如何0基础自学mysql](https://www.zhihu.com/question/34840297) | | 9 | [爬虫抓取数据的简单实现](https://www.cnblogs.com/ao-xiang/p/6601228.html) | 10 | [python爬虫的入门课程](http://c.biancheng.net/view/2011.html) | | 11 | [html 菜鸟教程](https://www.runoob.com/html/html-tutorial.html) | 12 | [css 菜鸟教程](https://www.runoob.com/html/html-tutorial.html) | | 13 | [html W3c school](https://www.w3cschool.cn/html/) | 14 | [python3 菜鸟教程](https://www.runoob.com/?s=python3) | | 15 | [手把手pythonanywhere上部署flask](https://www.yuque.com/lokkk/mzsyqp/yowp7q/edit) | | | | | | | |