华帝i110866s25选7开讲查询——为什么我玩CF老是卡屏

【11086o】25选7lol队友死了系统说的是什么_百度知道
【11086o】25选7lol队友死了系统说的是什么
我有更好的答案
程海上生明月,天涯共此时若
采纳率:100%
简单地说就是反玛丽苏的一些东西,玛丽苏即在同人文中虚构出一个真实剧情中没有的主角,此主角往往很好很强大,与真实剧情中的人气角色纠缠不清,暧昧不断,桃花朵朵开。
为您推荐:
其他类似问题
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。11086shishicai台湾宾果——为什么我的CF登陆进去后一进游戏就自动被弹出来_百度知道
11086shishicai台湾宾果——为什么我的CF登陆进去后一进游戏就自动被弹出来
我有更好的答案
CF登陆进去后一进游戏就自动被弹出来首先检测下我们的电脑防火墙是否开启。如果开启了,这时我们在玩游戏的时候可以先将它关闭。关闭电脑防火墙后,我们再查看电脑是否安装杀毒软件。如果电脑有安装某款杀毒软件,这时我们打开软件。打开杀毒软件后,我们返回桌面查看桌面底部的软件栏。找到杀毒软件的图标后,我们用鼠标右键下。右键弹出选项列表,这里我们点击最后一个“退出”选项即可。再次返回游戏,查看是否自动退出。
采纳率:88%
来自团队:
为您推荐:
其他类似问题
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。纠纷处理 (9:00-18:00)
图书审核 (9:00-18:00)
成功加入购物车
衍水古旧书店
责任人/主编:&
&人民教育编辑部
出版单位:&
&中国教育报社
&1986-02 第 2 期 至 1986-12 第 12 期 总第 265 - 274 期
出版时间:&
责任人/主编:&
人民教育编辑部
出版单位:&
中国教育报社
1986-02 第 2 期 至 1986-12 第 12 期 总第 265 - 274 期
出版时间:&
八五品品相描述
请选择所在地
仅1件在售,欲购从速
卖家超过10天未登录
商品分类:
品相描述:八五品
&&边角轻微磨损,有三个装订孔。2期12期封面小残。
商品描述:
艺术品收藏&p&我们最近改进了ELF框架,并且在上面实现了DeepMind的AlphaGoZero及AlphaZero的算法。用两千块GPU训练约两到三周后得到的围棋AI,基本上超过了强职业的水平。我们和韩国棋院合作进行了一次测试,给这个AI单卡每步50秒搜索时间(每步搜索8万个局面),给人类棋手任意长时间思考,结果AI以14比0完胜。参与测试的棋手包括金志锡,申真谞,朴永训及崔哲瀚,在这里我们非常感谢他们的合作,大家都很尽力,一些棋局下了三四个小时极其精彩。这14局棋谱中的12局已经公开(有2局应棋手们的要求不公开)。&/p&&p&另外我们也和现在著名的LeelaZero比较了下。我们采用了LeelaZero除ponder外的缺省配置,及4月25日的公开权重(192x15, &u&&a href=&http://link.zhihu.com/?target=http%3A//zero.sjeng.org/networks/a1e5e9dcd1aee157dae68fbc8fcd24502ae7daf4d7948.gz& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&158603eb&/a&&/u&),结果我们的AI以200比0获胜。在此我们非常感谢Leela团队的工作,对于他们的开源精神,我们表示由衷的敬意。&/p&&p&这次我们将训练代码,测试代码及训练出来的模型(224x20)全部公开,首要目的是贯彻我们一直以来坚持的开源方针,让AI为全世界服务。其次是对于AlphaGoZero及AlphaZero这样非常优秀的算法,我们想要提供一个可重复的参考实现,让全球的研究者们能在这上面继续改进,充分发挥自己的创造力。最后是借此机会推广一下我们的ELF平台和PyTorch深度学习框架,希望更多的人能使用和完善它。&/p&&p&代码见:&u&&a href=&http://link.zhihu.com/?target=https%3A//github.com/pytorch/ELF& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&https://&/span&&span class=&visible&&github.com/pytorch/ELF&/span&&span class=&invisible&&&/span&&/a&&/u&&/p&&p&模型见:&a href=&http://link.zhihu.com/?target=https%3A//github.com/pytorch/ELF/releases& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&pytorch/ELF&/a&&/p&&p&与职业棋手的12局对局:&a href=&http://link.zhihu.com/?target=https%3A//github.com/pytorch/ELF/releases& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&pytorch/ELF&/a&&/p&&p&英文blog见:&a href=&http://link.zhihu.com/?target=https%3A//research.fb.com/facebook-open-sources-elf-opengo/& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&https://&/span&&span class=&visible&&research.fb.com/faceboo&/span&&span class=&invisible&&k-open-sources-elf-opengo/&/span&&span class=&ellipsis&&&/span&&/a&&/p&&p&感谢大家的支持!&/p&&p&田渊栋,龚渠成&马子嫯(Jerry Ma), Shubho Sengupta, 陈卓远,Larry Zitnick&/p&&p&&br&&/p&&p&====================&/p&&p&Update: LeelaZero 这边我们确实用的是缺省配置,但“约一分钟一步”是不对的,LeelaZero在缺省配置下一开始会50秒一步,但除非是关键步,之后会用比较少的时间和搜索次数。所以我们这边在和LZ协商重跑一次测试。&br&&/p&&p&Update #2: 新测试结果是ELF OpenGo 198-2 LeelaZero (大家都用足50秒一步)。我们在跑1000局的比赛,届时会把所有的棋谱全都放出。&/p&
我们最近改进了ELF框架,并且在上面实现了DeepMind的AlphaGoZero及AlphaZero的算法。用两千块GPU训练约两到三周后得到的围棋AI,基本上超过了强职业的水平。我们和韩国棋院合作进行了一次测试,给这个AI单卡每步50秒搜索时间(每步搜索8万个局面),给人类…
&figure&&img src=&https://pic4.zhimg.com/v2-c53e5b2cfd247bc204db_b.jpg& data-rawwidth=&1280& data-rawheight=&600& class=&origin_image zh-lightbox-thumb& width=&1280& data-original=&https://pic4.zhimg.com/v2-c53e5b2cfd247bc204db_r.jpg&&&/figure&&p&有不少编程初学者会问这样一个问题:&b&我英语不好,还能不能学编程?会不会有影响?&/b& &/p&&p&我的回答是:&b&能,会。&/b&&/p&&p&能学,是因为虽然编程用的都是英语,但翻来覆去就那么一些关键字,写一阵子就都记住了。中文的学习资料也不少,足够学会。&/p&&p&但肯定会有影响,主要有几点:&/p&&ol&&li&看不懂&b&报错信息&/b&&/li&&li&看不懂&b&官方文档&/b&,只能看别人翻译的二手货。翻译版本不能准确传达意思不说,很多前沿技术的版本更新速度也比翻译的速度快多了。你看 Django 就从来没有一个中文版本能跟上的。&/li&&li&看不懂 &b&StackOverflow&/b& 上的问答&/li&&li&无法使用参与 &b&Github&/b& 上的项目&/li&&li&没法好好用 &b&Google&/b&(当然这不仅是英语问题)&/li&&/ol&&p&总结下来就是:&b&可以学,但会吃力,尤其在更进一步提升时会有限制。而如果英语好,则事半功倍。&/b&&/p&&p&而英语本身的作用也不仅仅是对编程帮助。多花点时间学英语,哪怕仅仅多背一些单词也是有用的。&/p&&p&于是,为了让编程小白+英语苦手在开始时能有些方向,我们尝试用程序整理了一份&b&Python 高频词汇表&/b&,供参考。&/p&&blockquote&网页演示地址:&a href=&https://link.zhihu.com/?target=http%3A//lab.crossincode.com/recite/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Crossin的编程教室-Python必背单词整理&/a& &br&&b&扇贝单词本&/b&(可导入你的扇贝单词使用)和项目完整&b&代码&/b&及说明&b&文档、单词列表&/b&,请在公众号(&u&Crossin的编程教室&/u&)回复 &b&背单词&/b&,获取地址。&/blockquote&&p&&b&【关于这份词汇表的说明】&/b&&/p&&p&内容来源包括&/p&&ul&&li&《Head First Python》、《Learn Python The Hard Way》、《Python for Data Analysis》等20多本Python书籍;&/li&&li&Python 官方文档、pandas、requests、django 等10份文档;&/li&&li&Github awesome-python 项目下近400个项目的 readme 说明;&/li&&li&stackoverflow 下 Python 及常用库的问答 topics 400+ 回答等资源。&/li&&/ul&&p&通过程序从中采集了词频最高的单词,再加上人工筛选,最终整理出近 2000 个单词。&/p&&p&需要指出的是,单词的中文释义我们使用了金山的翻译接口。但某些词汇在计算机和编程领域有特殊的含义,翻译接口未必能够给出,所以会存在一定的问题。对此,我们在自建的网页版工具上提供了“&b&用户自定义解释&/b&”的接口,供大家修正和补充解释。如果遇到解释不到位的单词,欢迎各位提交补充。(但扇贝上已提交的单词本暂无法修改释义)&/p&&figure&&img src=&https://pic2.zhimg.com/v2-ff54e2a053b_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&574& data-rawheight=&1010& class=&origin_image zh-lightbox-thumb& width=&574& data-original=&https://pic2.zhimg.com/v2-ff54e2a053b_r.jpg&&&/figure&&p&&b&【程序的实现方法&/b& 】&/p&&p&&b&1. 文档抓取&/b&&/p&&p&4 个不同渠道来源,通过 &b&requests + BeautifulSoup&/b& 实现。&/p&&p&&b&2. 词频统计&/b&&/p&&p&用到了之前提过的 &b&Counter&/b& 类。可参考 &a href=&https://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMjM5MDEyMDk4Mw%3D%3D%26mid%3D%26idx%3D2%26sn%3Dca8bbc637c61fe5f2cd0af%26chksm%3Dbe4b593f893cd029c88b002bc53e8d83849aaa21b8f5593bca1d660eff8a74d1b9%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&【编程课堂】计数器 Counter&/a&&/p&&div class=&highlight&&&pre&&code class=&language-python3&&&span&&/span&&span class=&kn&&import&/span& &span class=&nn&&re&/span&
&span class=&kn&&from&/span& &span class=&nn&&collections&/span& &span class=&k&&import&/span& &span class=&n&&Counter&/span&
&span class=&c1&&# 打开文件,读取数据&/span&
&span class=&k&&with&/span& &span class=&nb&&open&/span&&span class=&p&&(&/span&&span class=&n&&filename&/span&&span class=&p&&,&/span& &span class=&s1&&'r'&/span&&span class=&p&&,&/span& &span class=&n&&encoding&/span&&span class=&o&&=&/span&&span class=&s1&&'utf-8'&/span&&span class=&p&&)&/span& &span class=&k&&as&/span& &span class=&n&&f&/span&&span class=&p&&:&/span&
&span class=&n&&raw_words&/span& &span class=&o&&=&/span& &span class=&n&&f&/span&&span class=&o&&.&/span&&span class=&n&&read&/span&&span class=&p&&()&/span&
&span class=&c1&&# 正则匹配所有单词&/span&
&span class=&n&&words&/span& &span class=&o&&=&/span& &span class=&n&&re&/span&&span class=&o&&.&/span&&span class=&n&&findall&/span&&span class=&p&&(&/span&&span class=&s1&&'[a-z]+'&/span&&span class=&p&&,&/span& &span class=&n&&raw_words&/span&&span class=&o&&.&/span&&span class=&n&&lower&/span&&span class=&p&&())&/span&
&span class=&c1&&# 统计单词&/span&
&span class=&n&&c&/span& &span class=&o&&=&/span& &span class=&n&&Counter&/span&&span class=&p&&(&/span&&span class=&n&&words&/span&&span class=&p&&)&/span&
&span class=&c1&&# 提取出前词频前 100 的单词&/span&
&span class=&n&&c&/span&&span class=&o&&.&/span&&span class=&n&&most_common&/span&&span class=&p&&(&/span&&span class=&mi&&100&/span&&span class=&p&&)&/span&
&/code&&/pre&&/div&&p&&b&3. 翻译接口&/b&&/p&&p&使用了&b&金山的API&/b&。&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&import requests
url = 'http://www.iciba.com/index.php?a=getWordMean&c=search&word=' + word
req = requests.get(url)
# 处理返回的JSON数据
info = req.json()
data = info['baesInfo']['symbols'][0]
means = data['parts'][0]['means']
&/code&&/pre&&/div&&p&&b&4. 网站展示&/b&&/p&&p&网站基于 &b&django&/b& 搭建。数据的导入使用了 &b&peewee&/b& 库,直接与 django 的 ORM 对接。&/p&&p&网页演示地址:&a href=&https://link.zhihu.com/?target=http%3A//lab.crossincode.com/recite/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Crossin的编程教室-Python必背单词整理&/a&&/p&&blockquote&完整的代码和更详细说明可在 Github 的项目中查看。&br&在公众号回复 &b&背单词&/b&,可获取扇贝单词本地址和项目完整代码、单词表及说明文档。&/blockquote&&p&&br&&/p&&p&════&br&&i&其他文章及回答:&/i&&/p&&p&&a href=&https://www.zhihu.com/question//answer/& class=&internal&&如何自学Python&/a& | &a href=&https://zhuanlan.zhihu.com/p/& class=&internal&&新手引导&/a& | &a href=&https://zhuanlan.zhihu.com/p/& class=&internal&&精选&/a&&a href=&https://zhuanlan.zhihu.com/p/& class=&internal&&Python&/a&&a href=&https://zhuanlan.zhihu.com/p/& class=&internal&&问答&/a&&/p&&p&欢迎关注:&b&Crossin的编程教室&/b&&/p&
有不少编程初学者会问这样一个问题:我英语不好,还能不能学编程?会不会有影响? 我的回答是:能,会。能学,是因为虽然编程用的都是英语,但翻来覆去就那么一些关键字,写一阵子就都记住了。中文的学习资料也不少,足够学会。但肯定会有影响,主要有几点…
&figure&&img src=&https://pic4.zhimg.com/v2-5a3fa5304210cfb2a1fb_b.jpg& data-rawwidth=&1600& data-rawheight=&1360& class=&origin_image zh-lightbox-thumb& width=&1600& data-original=&https://pic4.zhimg.com/v2-5a3fa5304210cfb2a1fb_r.jpg&&&/figure&&p&系列授权转载自 &a class=&member_mention& href=&https://www.zhihu.com/people/751fb303ed4b5fd092538a& data-hash=&751fb303ed4b5fd092538a& data-hovercard=&p$b$751fb303ed4b5fd092538a&&@李明&/a&的简书&/p&&p&&a href=&https://link.zhihu.com/?target=http%3A//www.jianshu.com/p/0f& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&简书原文&/a&&/p&&blockquote&压总一晚两篇的产量。。。。吓得我肾疼,惹不起惹不起&/blockquote&&p&&br&&/p&&p&&br&&/p&&p&&br&&/p&&p&本篇我们运用&a href=&https://link.zhihu.com/?target=http%3A//www.jianshu.com/p/aed& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&&Web框架如何快速入门&&/a&的原理来制作一篇Python-Flask框架的快速入门指南来实战之前的原理, 希望看完这次实战的过程, 你可以根据你想要学习的框架的文档和网络资料来做好自己的快速入门计划.&/p&&p&首先找到Flask的官方文档:
&a href=&https://link.zhihu.com/?target=http%3A//flask.pocoo.org/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&http://flask.pocoo.org&/a& &/p&&p&首先找到如何启动一个最小规模的可以运行的Helloword&/p&&figure&&img src=&https://pic4.zhimg.com/v2-c108c5e005c83c840af06_b.jpg& data-rawwidth=&1240& data-rawheight=&241& class=&origin_image zh-lightbox-thumb& width=&1240& data-original=&https://pic4.zhimg.com/v2-c108c5e005c83c840af06_r.jpg&&&/figure&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&
最小的可执行程序: hello.py
&/code&&/pre&&/div&&p&在hello.py所在的目录运行程序&/p&&figure&&img src=&https://pic3.zhimg.com/v2-ccb0ef303bc2fbf94d6f220_b.jpg& data-rawwidth=&1240& data-rawheight=&133& class=&origin_image zh-lightbox-thumb& width=&1240& data-original=&https://pic3.zhimg.com/v2-ccb0ef303bc2fbf94d6f220_r.jpg&&&/figure&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&
运行hello.py
&/code&&/pre&&/div&&p&完成上面步骤就可以开始入门之旅了.&/p&&p&&br&&/p&&h2&&b&一. 定义控制器和配置路由&/b&&/h2&&p&Flask 中的控制器就是一个简单的函数, 控制器的路由配置通过给函数加上装饰器来实现.&/p&&p&文档中位置:&a href=&https://link.zhihu.com/?target=http%3A//flask.pocoo.org/docs/0.12/quickstart/%23routing& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Routing&/a&&/p&&p&&br&&/p&&h2&1.1 定义方法&/h2&&p&@app.route('URL', methods=[允许接收的HTTP方法列表])&/p&&p&&br&&/p&&h2&1.2 URL参数&/h2&&p&在URL中带有&参数名&这样的部分或者&参数名:参数类型&这样的写法, 就可以在URL中定义参数, 比如 '/get_file/&file_name&' 或者 '/get_file_by_id/&file_id:int&'.&/p&&p&&br&&/p&&p&定义了参数的URL路由对应的函数, 必须包含对应的参数, 比如&/p&&figure&&img src=&https://pic4.zhimg.com/v2-db40d4dcfa13f70dd98bf_b.jpg& data-rawwidth=&1240& data-rawheight=&322& class=&origin_image zh-lightbox-thumb& width=&1240& data-original=&https://pic4.zhimg.com/v2-db40d4dcfa13f70dd98bf_r.jpg&&&/figure&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&
&/code&&/pre&&/div&&p&参数如果带了类型, 必须是下面几种类型之一:&/p&&p&1) string 不能包含反斜杠&/p&&p&2) int 整数&/p&&p&3) float 浮点数或者整数&/p&&p&4) path 包含反斜杠在内的字符串&/p&&p&5) any 所有的字符&/p&&p&6) uuid 只允许uuid字符串&/p&&p&如果定义了类型, flask会将传入的参数转换成对应的类型.&/p&&p&&br&&/p&&h2&&b&二. 输入输出&/b&&/h2&&p&大部分获取环境数据的方法都是通过flask的request对象类获取的, 详细文件可以参见:&a href=&https://link.zhihu.com/?target=http%3A//flask.pocoo.org/docs/0.12/api/%23incoming-request-data& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&传送门&/a&&/p&&p&而输出的对象是flask的Response类的实例, 可以通过make_response来生成, 详细的文档可见:&a href=&https://link.zhihu.com/?target=http%3A//flask.pocoo.org/docs/0.12/api/%23response-objects& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&传送门&/a&&/p&&p&&br&&/p&&h2&2.1. 如何获取Query String参数?&/h2&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&from flask import request
request.args.get('name')
&/code&&/pre&&/div&&p&request是当前请求的flask.Request类的实例. 属性args可以当作一个字典来访问.&/p&&p&&br&&/p&&h2&2.2.如何获取Form表单的数据(Json body)?&/h2&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&from flask import request
request.form.get('name')
&/code&&/pre&&/div&&p&form属性是封装过的类似字段的数据类型, 支持一个key有多个值, 当一个key有多个值的时候, 通过key获取到的是一个数组, 包含了所有这个key的值.&/p&&p&request.json 可以获取用Json body方式提交的数据, request.is_json 可以用来检测body里是不是json类型的数据.&/p&&p&原始的body数据通过 request.data 访问&/p&&p&&br&&/p&&h2&2.3. 如何读取和修改cookie?&/h2&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&from flask import request
request.cookies.get('name')
&/code&&/pre&&/div&&p&cookies是一个类似字典的数据结构, 按照字典的方式访问即可. 这个字典是只读的, 所以设置cookie要通过Response对象&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&from flask import make_response
response = make_response('&h1&Test&/h1&')
response.set_cookie('name', value)
&/code&&/pre&&/div&&h2&2.4. 如何获取headers?&/h2&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&from flask import headers
request.headers.get('Authorization')
&/code&&/pre&&/div&&p&headers是一个类似字典的数据结构, 按照字段的方式访问&/p&&h2&2.5. 如何实现页面转跳?&/h2&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&from flask import redirect
redirect('url')
&/code&&/pre&&/div&&h2&2.6. 如何输出Http响应?&/h2&&p&输出模板渲染结果&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&from flask import render_template
@app.route('/')
def handler():
return render_template('template_path', **locals())
&/code&&/pre&&/div&&p&输出json&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&from flask import jsonify
@app.route('/')
def handler():
return jsonify(key=value...)
&/code&&/pre&&/div&&h2&&b&三. 模板引擎&/b&&/h2&&p&flask内置了jinja2模板, 并且入上一节提供了render_template快捷方法. 只要在hello.py所在目录下创建个目录-templates, 把模板文件放进去就好了.&/p&&p&jinja2的模板就是一个普通的html文件, 其中加入jinja2的占位符即可.&/p&&p&&br&&/p&&h2&3.1. 占位符如何定义&/h2&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&{{ key }}
&/code&&/pre&&/div&&p&render_template的keywords参数传入的key, 用{{ }} 括起来就是一个占位符了. 模板中新定义的变量用{{ }}括起来也是一个占位符.&/p&&p&&br&&/p&&h2&3.2. 如何定义循环&/h2&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&{% for item in 列表 %}
&h1&{{ item.property }}&/h1&
{% endfor %}
&/code&&/pre&&/div&&h2&3.3. 如何定义判断条件&/h2&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&{% if 判断条件 %}
{% else %}
{% endif %}
&/code&&/pre&&/div&&h2&3.4. 如何对占位符加过滤器&/h2&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&{{ variable | 过滤器名 }}
&/code&&/pre&&/div&&p&flask内置了几个过滤器 tojson和safe, 如果需要还可以自己定义自定义过滤器. 过滤器可以嵌套使用, 比如 {{ var | tojson | safe
}}&/p&&h2&3.5. 如何定义继承模板&/h2&&p&首先要定义一个基础模板, 比如base.html, 在其中需要继承模板替换的地方, 定义一个命名的block, 比如:&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&{% block name%} {% endblock %}
&/code&&/pre&&/div&&p&然后定义一个集成模板, 比如 enh.html, 第一行定义 extends 来指明继承自哪个基模板, 然后用block来覆盖基模板的相同名字的block&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&{% extends &base.html& %}
{% block name %}
&h1&子模板内容&/h1&
{% endblock %}
&/code&&/pre&&/div&&p&&br&&/p&&h2&3.6. 如何定义嵌套模板&/h2&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&{% include &snap.html& %}
&/code&&/pre&&/div&&h2&&b&四.中间件&/b&&/h2&&p&通过装饰器将函数注册为中间件的钩子&/p&&p&@app.before_first_request
当第一个请求执行前执行&/p&&p&@app.before_request 每一个请求执行前执行&/p&&p&@app.after_request 每一个请求执行后执行&/p&&p&@app.teardown 当请求执行抛出未catch的异常后执行&/p&&h2&&b&五.统一错误处理&/b&&/h2&&p&通过@app.teardown&/p&&h2&&b&六.鉴权和Session&/b&&/h2&&p&flask没有提供自带的鉴权机制, 但是为了方便你自己实现鉴权, flask提供了一些机制&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&from flask import request
user_name = request.authorization.user_name
password = request.authorization.password
&/code&&/pre&&/div&&p&可以获取到Basic Auth的鉴权信息&/p&&p&Session读写&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&from flask import session
session[key] = value
variable = session[key]
&/code&&/pre&&/div&&p&Flask的Session是基于cookie的, 所以不要放入太大的内容&/p&&p&&br&&/p&&h2&&b&七.生产部署的方式&/b&&/h2&&p&用gunicorn来host应用服务&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&pip install gunicorn
然后就可以用
gunicorn -w worker进程数量 -b 绑定IP:端口号 --timeout 执行超时时间 hello:app
的方式启动
&/code&&/pre&&/div&&p&Web服务器用Nginx, 通过Upstream把请求反向代理到gunicorn的应用服务&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&upstream api {
server 127.0.0.1:端口;
listen 80;
server_name 域名;
location /static {
root /静态文件地址;
location / {
proxy_pass_header S
proxy_set_header Host $http_
proxy_set_header X-Real-IP $remote_
proxy_set_header X-Scheme $
proxy_pass http://
proxy_next_
&/code&&/pre&&/div&&p&&br&&/p&&p&按照以上套路学习完毕看是不是可以入门Flask了呢?&/p&&p&&/p&&p&&/p&
系列授权转载自 的简书压总一晚两篇的产量。。。。吓得我肾疼,惹不起惹不起 本篇我们运用的原理来制作一篇Python-Flask框架的快速入门指南来实战之前的原理, 希望看完这次实战的过程, 你可以根据你想要学习的框架的文档…
&figure&&img src=&https://pic4.zhimg.com/v2-af7ef37d7ada5e8d3848267_b.jpg& data-rawwidth=&939& data-rawheight=&539& class=&origin_image zh-lightbox-thumb& width=&939& data-original=&https://pic4.zhimg.com/v2-af7ef37d7ada5e8d3848267_r.jpg&&&/figure&&p&左手用R右手Python系列已经更新了将近50+篇了,也算是完成了之前定下的目标(入职之前搞定Python入门)。&/p&&p&&br&&/p&&p&两个放在一起写,一方面是为了利用相对熟练的R语言来帮助理解Python基础语法,另一方面想对比两者在各个功能模块以及函数用法中的区别。&br&&/p&&p&&br&&/p&&p&工作之后的时间可能没有在学校这么自由,以后的精力会更多的兼顾数据分析、机器学习、数据可视化综合运用方面。(特别是机器学习是文科僧难以逾越的鸿沟)。&/p&&p&&br&&/p&&p&一直把R和Python的文章索引放在R语言学习笔记里,好像也不是那么回事儿, 毕竟以后还会更新很多Python的内容。索引是时候给Python的内容单列出来了。&/p&&p&&br&&/p&&p&以下是自入门以来的所有Python学习笔记:&/p&&p&&br&&/p&&p&1、字符串处理:&/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D717f09ae1cd83c0e5d4b9%26chksm%3D848c445db3fbcd4b94bb7c32c2f1cdae316%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左右用R右手Python系列——字符串格式化输出&/a&&/u&&/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D60427fdd78abb161df5abd3c%26chksm%3D848c45c8b3fbccdecd98d7a1e32b417b5b356bada88ac7c4741eeef5db%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列——字符串合并与拆分&/a&&/u&&/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3Df1ee0b27f5cbc2%26chksm%3D848c461db3fbcf0b42c56dcbb5ded315ad6082efd407%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列——字符串处理与正则表达式&/a&&/u&&/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3Db9c2b62ec81a9edbce399%26chksm%3D848cb801b3fbb11d2e18f037f847d7a4f25bfc5ddbce01c1scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列之——字符串格式化进阶&/a&&/u& &/p&&p&&br&&/p&&p&2、数据清洗&/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3Ddae265a766eca9a07c1d071%26chksm%3D848c447bb3fbcd6d2d5c5cff7d39ef7ea7e454d323b5df91605e73ff%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列——数据合并与追加&/a&&/u& &/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3Dbca4eecdff6e08d6fa4b3d9%26chksm%3D848c4403b3fbcdefded410eb27dab29b3834fae7f918e7d258b%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列——数据塑型与长宽转换&/a&&/u& &/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D590a96b310bbedc7d5674fc0bcf177a0%26chksm%3D848c443fb3fbcd29cc02a48a3dc5cccac7a14db72adce66ef97b098f%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列——因子变量与分类重编码&/a&&/u&&/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D90dc00d8a5d4d4a0fab09a85achksm%3D848c454ab3fbcc5ce32bfb2b3837ebfd7eb9eb24dc1dc633faf6ede90c36e81e0%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列——数据切片与索引&/a&&/u& &/p&&p&&br&&/p&&p&&br&&/p&&p&3、统计计算&/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3Da206b68b97c26e3a63d9e5%26chksm%3D848c4624b3fbcf322c173de19b4aca9afdcd0d141ed40a459fc87c17b3e6cb778%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列14——日期与时间处理&/a&&/u&&/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D76ccchksm%3D848c4567b3fbcc718ff65ade515bffad9fbb80fb2d416c1fscene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列——变量计算与数据聚合&/a&&/u& &/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3Dffd32e73ed360d5%26chksm%3D848c450fb3fbcc199bed34fbeed075acfe7befdc1905cde6a%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列——排序&/a&&/u& &/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3Dabb15b9cd0256fcb%26chksm%3D848c4517b3fbcc01ae695deeddfb20ede%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列——数据去重与缺失值处理&/a&&/u&&/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D29c5fc164d8c6b28d7b5b%26chksm%3D848c45f5b3fbcce7b0a61c4ad4c8aeda889c551e6e88b29b0060b%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列10——统计描述与列联分析&/a&&/u& &/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D97f8f983f%26chksm%3D848c4591b3fbcccc69a75b7b57c6c3b7a45e8a36dc12691bca4ef0d%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列11——相关性分析&/a&&/u& &/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D554e2e7d0fc0ccchksm%3D848c47e8b3fbcefed6edcc613af4d53cae1%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列之——数据框与apply向量运算&/a&&/u&&/p&&p&&br&&/p&&p&4、数据可视化&/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3Dd3e24cffb24f50e58a0a54e75c60f817%26chksm%3D848c466eb3fbcf58e8913f1bcd8a7adffc6928bccd765b15f5adac%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列——空间数据可视化与数据地图&/a&&/u& &/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D223b1aa0eefbe%26chksm%3D848c4606b3fbcf105fc627ce19bf7c7fa8e6f108ddc6e3b9e584d6b229e0b9b22%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&空间数据可视化笔记——simple features空间对象基础&/a&&/u& &/p&&p&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3Da3ddba2e7f80echksm%3D848c4742b3fbce54dbd6dfdefddefdab7e934df%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Python数据抓取与可视化实战——网易云课堂人工智能与大数据板块课程实战&/a&&/p&&p&&br&&/p&&p&5、数据抓取:&/p&&p&&br&&/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3Deaaceac1d5b0855ab87dfebd2aca91c0%26chksm%3D848c46f7b3fbcfe12d48c380e1ff928cad73be84bad30d7041415dadf2e13fd8%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列——XPath与网页解析库&/a&&/u& &/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D31b4e903f181a7ed841b5d%26chksm%3D848c46f3b3fbcfe5bc1c9e40b4beea334c796a3ab72ea%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列——CSS表达式与网页解析&/a&&/u& &/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3Db0c145d425f65c52ae98%26chksm%3D848c47ecb3fbcefa386dfca336bca798d74b87993fdbfdd5c989f956%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列——json序列化与反序列化&/a&&/u&&/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3Da465cc58eb198ae10ddcd002bda93bdf%26chksm%3D848c4509b3fbcc1fe750ce787b2d5e06abfa335a4b04fe%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&同时用R语言和Python爬取知乎美图&/a&&/u& &/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D7458a37dcbe99de9cf549b6achksm%3D848c45b6b3fbccab2caee6eca6fb94bfeee5c40de167db303a3cef221f2%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&网易云课堂Excel课程爬虫思路&/a&&/u&&/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D07fef80f4c9cbbcdf8dff2e%26chksm%3D848c46d1b3fbcfc78ed5fabebabbd28fac2cc2e0ad3c060f%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列——模拟登陆教务系统&/a&&/u& &/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D4e242d7adf024a03e82ed0c%26chksm%3D848c468eb3fbcfdee09bb6fa500ef37e3ab274de4b28fa5f2eb84460f%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Python网络数据抓取实战——Xpath解析豆瓣书评&/a&&/u& &/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D0af1c0023f70ced27ed1c%26chksm%3D848c4684b3fbcfc77c5ebfacb905c32a7463abfbdf9ed398%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python——CSS网页解析实战&/a&&/u&&/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D4528d5d9d%26chksm%3D848c4691b3fbcfd5ddd5c5f44aba03b093d85a3adfce%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Pyhon系列——趣直播课程抓取实战&/a&&/u&&/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3Df6015abea510a5b41cc96fb%26chksm%3D848c471cb3fbce0a096b8034db8dea585d7f4bf26fcd55fd36b3a864c945ad7b%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&XML/HTML/JSON——数据抓取过程中不得不知的几个概念&/a&&/u& &/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3Df5dea1e91d60bc1bchksm%3D848c472eb3fbce3d6bf19d5516f80efeb3e32f7ffdec710ff7fb3e8%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列之——表格数据抓取之道&/a&&/u& &/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3Dd8cffe5da036%26chksm%3D848c473bb3fbce2de072a6f323b976891baecf43c9fea8e65836b7fbf2cb4e19e82bbfee423b%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&异步加载的基本逻辑与浏览器抓包一般流程&/a&&/u&&/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D07fef80f4c9cbbcdf8dff2e%26chksm%3D848c46d1b3fbcfc78ed5fabebabbd28fac2cc2e0ad3c060f%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列——模拟登陆教务系统&/a&&/u&&/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3Dbfb5d25a6319ebc1031c56bab0e6361f%26chksm%3D848c47aeb3fbceb8da198680eecb79c101c5d6c8acbdccddscene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列——动态网页抓取与selenium驱动浏览器&/a&&/u& &/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D9179cddf31f953e5cc45adac20ba83a7%26chksm%3D848cb858b3fb314eeeb5d1bbf3b747b1aaa9dc4feea8b857c0d2c2b66b0fcf3b39b%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列——使用多进程进行任务处理&/a&&/u& &/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D3dedfd023779cae7a786d%26chksm%3D848cb86bb3fb317dd4077bbab34f5c17caf6c767f4e781785bedcd3b%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列——多进程/线程数据抓取与网页请求&/a&&/u&&/p&&p&&br&&/p&&p&&br&&/p&&p&6、程序设计&/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3Dba83e4a70fc1%26chksm%3D848c46aab3fbcfbcc8c53dda0e8feb4ce1decd4a9b9d9ad%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列——任务进度管理&/a&&/u& &/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D8fe3aa1abad396ea20f13aed82f000a1%26chksm%3D848c4750b3fbce46fda63f966af0f7b2dc194e07b215e74f837ad57c48dscene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列——异常捕获与容错处理&/a&&/u& &/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D6cdf8a2a8aec467aab931dc21ca43849%26chksm%3D848c477fb3fbce69df532c923f43a2b22b192d243dd1fe69eea4f01ef1527c86bb%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列——循环中的错误异常规避&/a&&/u&&/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D5ab2be88eba26dchksm%3D848c47eab3fbcefccdfa3c1eeb75c836e872b761dfd5aeb659d0a0%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列之——迭代器与迭代对象&/a&&/u& &/p&&p&&br&&/p&&p&7、数据库:&/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3Dc68c8407a1efb34a4bc63e85dfe88865%26chksm%3D848c478ab3fbce9c4db5afcfc656feff6e0f1874e1aeac37012aef3fe249d764c9%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&MySQL数据库基础——本地文件交互&/a&&/u&&/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D2c77d87bb%26chksm%3D848c47fbb3fbceed8c7fd0f0ccbb01a3bdd67e8f2cc42bc7cfd894b9804%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列——noSQL基础与mongodb入门&/a&&/u&&/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D5fe1f9fabbb702c68998%26chksm%3D848c4799b3fbce8f04f9bcac3f6dfce28b37%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&MySQL入门学习笔记——七周数据分析师实战作业&/a&&/u& &/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3Dbd98d7faf733d%26chksm%3D848cb846b3fb3150a5caf510edfe025acdee3b101f9068%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&MySQL基础入门——MySQL与R语言、Python交互&/a&&/u&&/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D765dcb0c578a95cchksm%3D848c4793b3fbce85a18b84aceb80f2fcbcda6d022dcf674a7ff109%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&左手用R右手Python系列——七周数据分析师学习笔记R语言、Python版&/a&&/u& &/p&&p&&u&&a href=&http://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzA3Njc0NzA0MA%3D%3D%26mid%3D%26idx%3D1%26sn%3Dd1a5dbd4f026ce9d1b46d5%26chksm%3D848c47b1b3fbceae06bea0ce22b1d1fea5d0edc240ccf395fca2db2d%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&MySQ基础入门系列之——字符与日期数据处理&/a&&/u& &/p&&p&&br&&/p&&p&在线课程请点击文末原文链接: &/p&&a href=&http://link.zhihu.com/?target=https%3A//edu.hellobi.com/course/195/lessons& data-draft-node=&block& data-draft-type=&link-card& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Hellobi Live | R语言可视化在商务场景中的应用&/a&&p&往期案例数据请移步本人GitHub: &/p&&a href=&http://link.zhihu.com/?target=https%3A//github.com/ljtyduyu/DataWarehouse/tree/master/File& data-draft-node=&block& data-draft-type=&link-card& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&https://&/span&&span class=&visible&&github.com/ljtyduyu/Dat&/span&&span class=&invisible&&aWarehouse/tree/master/File&/span&&span class=&ellipsis&&&/span&&/a&&p&&/p&
左手用R右手Python系列已经更新了将近50+篇了,也算是完成了之前定下的目标(入职之前搞定Python入门)。 两个放在一起写,一方面是为了利用相对熟练的R语言来帮助理解Python基础语法,另一方面想对比两者在各个功能模块以及函数用法中的区别。 工作之后的…
&figure&&img src=&https://pic4.zhimg.com/v2-aebba89ae435_b.jpg& data-rawwidth=&720& data-rawheight=&428& class=&origin_image zh-lightbox-thumb& width=&720& data-original=&https://pic4.zhimg.com/v2-aebba89ae435_r.jpg&&&/figure&&p&源码地址:&a href=&https://link.zhihu.com/?target=https%3A//github.com/moranzcw/PlayJumpGame& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&moranzcw/PlayJumpGame&/a&&/p&&a class=&video-box& href=&https://link.zhihu.com/?target=https%3A//www.zhihu.com/video/743808& target=&_blank& data-video-id=&& data-video-playable=&true& data-name=&& data-poster=&https://pic3.zhimg.com/80/v2-0009eb9fba98ccdb97f56_b.jpg& data-lens-id=&743808&&
&img class=&thumbnail& src=&https://pic3.zhimg.com/80/v2-0009eb9fba98ccdb97f56_b.jpg&&&span class=&content&&
&span class=&title&&&span class=&z-ico-extern-gray&&&/span&&span class=&z-ico-extern-blue&&&/span&&/span&
&span class=&url&&&span class=&z-ico-video&&&/span&https://www.zhihu.com/video/743808&/span&
&h2&工具&/h2&&ul&&li&Windows PC&/li&&li&安卓模拟器 for Windows(新版本微信的跳一跳需要Android 5.0及以上,大多数模拟器都是Android 4.4.4的,笔者找到一款,叫雷电模拟器,支持Android 5.0)&/li&&li&Python 3.6&/li&&li&&a href=&https://link.zhihu.com/?target=https%3A//sourceforge.net/projects/pywin32/files/pywin32/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&pywin32&/a&(python的windows扩展,用于windows截屏)&/li&&li&&a href=&https://link.zhihu.com/?target=http%3A//pillow.readthedocs.io/en/latest/installation.html& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Pillow&/a&(图片处理库,用于分析图像)&/li&&/ul&&h2&用法&/h2&&ul&&li&下载脚本:&a href=&https://link.zhihu.com/?target=https%3A//github.com/moranzcw/PlayJumpGame& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&GitHub&/a&&/li&&li&安装Python 3,pywin32,Pillow和安卓模拟器。&/li&&li&在模拟器中运行最新版微信(6.6.1及以上),打开跳一跳,开一局,进入到准备起跳的界面&/li&&li&运行脚本play_jump_game.py&/li&&li&按提示移动鼠标,框出游戏区域:&/li&&/ul&&figure&&img src=&https://pic3.zhimg.com/v2-c4fbb2ca265b5de_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&750& data-rawheight=&1334& class=&origin_image zh-lightbox-thumb& width=&750& data-original=&https://pic3.zhimg.com/v2-c4fbb2ca265b5de_r.jpg&&&/figure&&ul&&li&脚本开始自动玩游戏&/li&&/ul&&h2&特点&/h2&&ul&&li&支持商店和音乐盒的识别,可以停下来加分。&/li&&li&能处理转弯(由向右跳变为向左跳或反之)带来的误差,几乎可以做到无限刷分。&/li&&li&精确落地(落到每个方块的正中心获得额外加分)的准确度达到70%~80%。&/li&&li&新版本跳一跳会检测每次点击的位置,以屏蔽机器操作。此脚本中加入了随机量来应对这一点.&/li&&/ul&&h2&效果&/h2&&figure&&img src=&https://pic4.zhimg.com/v2-eecbaaf17ccade4d42d02ee1edf0d4bb_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&720& data-rawheight=&1280& class=&origin_image zh-lightbox-thumb& width=&720& data-original=&https://pic4.zhimg.com/v2-eecbaaf17ccade4d42d02ee1edf0d4bb_r.jpg&&&/figure&&p&此图仅作参考,新版本跳一跳已屏蔽过高分数,虽然可以刷到10000多,但无法上传到排行榜上。&/p&
源码地址:工具Windows PC安卓模拟器 for Windows(新版本微信的跳一跳需要Android 5.0及以上,大多数模拟器都是Android 4.4.4的,笔者找到一款,叫雷电模拟器,支持Android 5.0)Python 3.6(python的windows扩展,用于window…
&p&&b&这是我在学习github的时候顺便写的教程,简单明了。&/b&&/p&&p&&br&&/p&&p&&b&更新&/b&&/p&&p&&b&---------------------------------&/b&&/p&&p&添加新旧对比图&/p&&p&&br&&/p&&p&&b&更新&/b&&/p&&p&&b&-----------------------------------&/b&&/p&&p&在使用技巧中添加一条查看代码比例。&/p&&p&&br&&/p&&p&&b&更新
&/b&&/p&&p&&b&-----------------------------------&/b&&/p&&p&添加GitHub for Windows使用教程(四)&/p&&p&主要是一些github使用技巧。&/p&&p&&br&&/p&&p&&br&&/p&&p&&b&博客地址&/b&&/p&&p&&br&&/p&&p&&a href=&//link.zhihu.com/?target=http%3A//youngxhui.github.io//GitHub-for-Windows%25E4%25BD%25BF%25E7%%25E6%E7%25A8%258B%28%25E4%25B8%2580%29/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&GitHub for Windows使用教程(一)&/a&&/p&&p&&a href=&//link.zhihu.com/?target=http%3A//youngxhui.github.io//GitHub-for-Windows%25E4%25BD%25BF%25E7%%25E6%E7%25A8%258B%28%25E4%25BA%258C%29/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&GitHub for Windows使用教程(二)&/a&&/p&&p&&a href=&//link.zhihu.com/?target=http%3A//youngxhui.github.io//GitHub-for-windows%25E4%25BD%25BF%25E7%%25E6%E7%25A8%258B%25EF%25BC%%25B8%2589%25EF%25BC%2589/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&GitHub for windows使用教程(三)&/a&&/p&&p&&a href=&//link.zhihu.com/?target=http%3A//youngxhui.github.io//GitHub-for-Windows%25E4%25BD%25BF%25E7%%25E6%E7%25A8%258B%25EF%25BC%%259B%259B%25EF%25BC%2589/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Github for windows使用教程(四)&/a&&/p&&p&&br&&/p&&p&&b&如若有错,还望指正。&/b&&/p&&p&&br&&/p&&p&如果你还不知道什么是git,只知道github,但是还不会用,我想这个教程会帮助你。&/p&&p&&br&&/p&&p&&b&前言&/b&&/p&&p&鉴于网上目前的教材都太落后,github for windows已经更新了多个版本,好多界面都发生了变化,所以来写这个教程。目的是为了帮助和我一样初学github,但是苦于找不到教程的同学,为了写最详细的教程。配备了大量的图文介绍。该教程是基于&b&GitHub for windows (3.0.17.0)&/b&&/p&&p&&b&注:&/b&&/p&&p&由于教程为 3.0.17.0 ,之后github对客户端进行了新版的更新,这里的图为新版与旧版对比。希望可以给大家带来帮助。&/p&&p&&br&&/p&&figure&&img src=&https://pic3.zhimg.com/50/v2-38f98b1a48dd602a3f19ea_b.jpg& data-rawwidth=&2778& data-rawheight=&1681& class=&origin_image zh-lightbox-thumb& width=&2778& data-original=&https://pic3.zhimg.com/50/v2-38f98b1a48dd602a3f19ea_r.jpg&&&/figure&&p&&br&&/p&&p&&br&&/p&&p&&br&&/p&&p&&br&&/p&&p&&b&什么是Github&/b&&/p&&p&说到什么事github,我们先看wikipedia的描述“&a href=&//link.zhihu.com/?target=https%3A//zh.wikipedia.org/wiki/GitHub& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&GitHub是一个利用Git进行版本控制、专门用于存放软件代码与内容的共享虚拟主机服务。它由GitHub公司(曾称Logical Awesome)的开发者Chris Wanstrath、PJ Hyett和Tom Preston-Werner使用Ruby on Rails编写而成。&/a&”&/p&&p&准备工作&/p&&ol&&li&下载&a href=&//link.zhihu.com/?target=https%3A//desktop.github.com/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&github for windows&/a&,安装这里不赘述。&/li&&li&&a href=&//link.zhihu.com/?target=https%3A//github.com/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&注册github账号&/a&&/li&&/ol&&figure&&img src=&https://pic4.zhimg.com/50/cbb9a0d3f35c92978cc77_b.jpg& data-rawwidth=&1904& data-rawheight=&956& class=&origin_image zh-lightbox-thumb& width=&1904& data-original=&https://pic4.zhimg.com/50/cbb9a0d3f35c92978cc77_r.jpg&&&/figure&&p&&br&&/p&&ol&&li&登陆到github for windows。&/li&&/ol&&figure&&img src=&https://pic2.zhimg.com/50/b69b539f7aa3f28e_b.jpg& data-rawwidth=&1224& data-rawheight=&672& class=&origin_image zh-lightbox-thumb& width=&1224& data-original=&https://pic2.zhimg.com/50/b69b539f7aa3f28e_r.jpg&&&/figure&&p&&br&&/p&&p&准备工作都完了,我们开始正式学习。^_^&/p&&p&&b&创建第一个代码库&/b&&/p&&p&&b&认识界面&/b&&/p&&figure&&img src=&https://pic1.zhimg.com/50/dabdb03cc2c79ad5fabc6c4_b.jpg& data-rawwidth=&1224& data-rawheight=&672& class=&origin_image zh-lightbox-thumb& width=&1224& data-original=&https://pic1.zhimg.com/50/dabdb03cc2c79ad5fabc6c4_r.jpg&&&/figure&&p&&br&&/p&&p&github for windows的界面非常清爽,的确符合geek的性质,个人表示非常喜欢。 我们来建立第一个仓库,点击左上角的&b&+号&/b&,初次建立他会有一圈圈的涟漪,非常漂亮哦。 打开之后有三个选项,&b&Add&/b&,&b&Create&/b&,&b&Clone&/b&。
我们分别来介绍一下这三个功能。&/p&&figure&&img src=&https://pic4.zhimg.com/50/9ada359dcf0b5eb355dfb4cf4de6cb84_b.jpg& data-rawwidth=&1224& data-rawheight=&672& class=&origin_image zh-lightbox-thumb& width=&1224& data-original=&https://pic4.zhimg.com/50/9ada359dcf0b5eb355dfb4cf4de6cb84_r.jpg&&&/figure&&p&&br&&/p&&p&&b&Add功能&/b&&/p&&p&如果本地有工程,就可以使用Add添加 &/p&&figure&&img src=&https://pic1.zhimg.com/50/28af723cdcb1ac3092985c_b.jpg& data-rawwidth=&572& data-rawheight=&249& class=&origin_image zh-lightbox-thumb& width=&572& data-original=&https://pic1.zhimg.com/50/28af723cdcb1ac3092985c_r.jpg&&&/figure&&p&&br&&/p&&p&&b&Clone功能&/b&&/p&&p&这个功能其实最好理解了,克隆这名字通俗易懂好理解。 如何使用Clone功能呢?
就是将在浏览器上已经创建好的项目导入到本地,换句话说就是下载到本地。&/p&&figure&&img src=&https://pic3.zhimg.com/50/af8a6aa46acc72e2c5d0649e_b.jpg& data-rawwidth=&573& data-rawheight=&598& class=&origin_image zh-lightbox-thumb& width=&573& data-original=&https://pic3.zhimg.com/50/af8a6aa46acc72e2c5d0649e_r.jpg&&&/figure&&p&&br&&/p&&p&&b&Create功能&/b&&/p&&p&创建一个代码库, Name填写你的仓库名字。Local path写你将要保存在本地路径。&/p&&figure&&img src=&https://pic4.zhimg.com/50/9357be0cae4b7f6aad90_b.jpg& data-rawwidth=&571& data-rawheight=&334& class=&origin_image zh-lightbox-thumb& width=&571& data-original=&https://pic4.zhimg.com/50/9357be0cae4b7f6aad90_r.jpg&&&/figure&&p&&br&&/p&&p&我们主要从这个功能开始github之旅。
我们在这里填写First,来创建第一个我们自己的repoeitory。 &/p&&figure&&img src=&https://pic2.zhimg.com/50/e0e795ffecb_b.jpg& data-rawwidth=&1224& data-rawheight=&672& class=&origin_image zh-lightbox-thumb& width=&1224& data-original=&https://pic2.zhimg.com/50/e0e795ffecb_r.jpg&&&/figure&&p&&br&&/p&&p&&b&开始使用第一个代码库&/b&&/p&&p&&b&修改第一个代码库中内容&/b&&/p&&p&我们来找到刚刚创建的代码库在本地的位置。就是刚刚在local path的地址路径,当然如果你忘了,请右键点击First。&/p&&p&&br&&/p&&figure&&img src=&https://pic1.zhimg.com/50/ece15b960e76cd4ddeef02_b.jpg& data-rawwidth=&1224& data-rawheight=&672& class=&origin_image zh-lightbox-thumb& width=&1224& data-original=&https://pic1.zhimg.com/50/ece15b960e76cd4ddeef02_r.jpg&&&/figure&&p&选择Open in Explorer。这样我们就可以转到刚刚的路径下。 我们新建一个文本文档。在里面编辑。 如下&br&&/p&&figure&&img src=&https://pic4.zhimg.com/50/42c0bbcbcea76d12bfd792_b.jpg& data-rawwidth=&1920& data-rawheight=&1038& class=&origin_image zh-lightbox-thumb& width=&1920& data-original=&https://pic4.zhimg.com/50/42c0bbcbcea76d12bfd792_r.jpg&&&/figure&&p&&br&&/p&&p&此时的github就会变成这个样子(Changs):&/p&&figure&&img src=&https://pic3.zhimg.com/50/61bea68f6c_b.jpg& data-rawwidth=&1224& data-rawheight=&672& class=&origin_image zh-lightbox-thumb& width=&1224& data-original=&https://pic3.zhimg.com/50/61bea68f6c_r.jpg&&&/figure&&p&&br&&/p&&p&你会发现此时github会出现刚刚编辑的内容。&/p&&ol&&li&这个是测试文本&/li&&li&你好
&/li&&/ol&&p&并且前面会有&b&蓝色标识&/b&,那么这个&b&蓝色标识&/b&是什么用呢? &/p&&p&其实这个蓝色标识是提示你会上改变的文本。比如我第一次只想改变 &b&这个是测试文本&/b&并不想把&b&你好&/b&上传。 这时我们点击一下&b&你好&/b&的前面的&b&蓝色标识&/b&。&/p&&figure&&img src=&https://pic3.zhimg.com/50/afc0daa610b77e2a92c51_b.jpg& data-rawwidth=&674& data-rawheight=&108& class=&origin_image zh-lightbox-thumb& width=&674& data-original=&https://pic3.zhimg.com/50/afc0daa610b77e2a92c51_r.jpg&&&/figure&&p&&br&&/p&&p&你会发现&b&你好&/b&前面的蓝色标识没有了。 &/p&&p&我们填写好&b&Summer&/b&和&b&Description&/b& Summer就是这次改动的总结,我们也可以理解为标题*(必填)&i&,而Description可以理解为详细概况&/i&(选填)*&/p&&p&&br&&/p&&p&我们这里只选择第一个修改对象,也就是&b&这个是测试文本&/b&就行修改。summer我们填写为&i&第一次修改&/i&,Description我们填写为&i&增加了这个是测试文本&/i&的内容,之后点击&b&Commit to master&/b&。 &/p&&figure&&img src=&https://pic4.zhimg.com/50/acce3c7a67c_b.jpg& data-rawwidth=&1224& data-rawheight=&672& class=&origin_image zh-lightbox-thumb& width=&1224& data-original=&https://pic4.zhimg.com/50/acce3c7a67c_r.jpg&&&/figure&&p&&br&&/p&&p&切换到&b&History&/b&目录下
我们会发现他改变了。 这次我们把&b&你好&/b&进行添加。&/p&&figure&&img src=&https://pic2.zhimg.com/50/6d0e86ae4e881fef4bf47fafa0a292cd_b.jpg& data-rawwidth=&1224& data-rawheight=&672& class=&origin_image zh-lightbox-thumb& width=&1224& data-original=&https://pic2.zhimg.com/50/6d0e86ae4e881fef4bf47fafa0a292cd_r.jpg&&&/figure&&p&&br&&/p&&p&在&b&History&/b&目录下发生了这样的改变。会在&b&History&/b&目录下形成一天时间线,来指出每一次的修改标题和内容,同时会把修改的内容用&b&绿色标识&/b&标出。 我们打开本地的文本,删除刚刚添加的第一行&b&这个是测试文本&/b&。&/p&&figure&&img src=&https://pic3.zhimg.com/50/695dd1c914da7_b.jpg& data-rawwidth=&1920& data-rawheight=&1035& class=&origin_image zh-lightbox-thumb& width=&1920& data-original=&https://pic3.zhimg.com/50/695dd1c914da7_r.jpg&&&/figure&&p&&br&&/p&&p&此时你就会发现github发生了变化。
此时的&b&红色标识&/b&标识删除。我们写好Summer和Description并点击Commit to master。 这样我们就删除了第一行。同时在&b&History&/b&目录下又多了一条时间轴。 &/p&&figure&&img src=&https://pic1.zhimg.com/50/420ec1f70c23f795ae0f03b3c0b95f03_b.jpg& data-rawwidth=&1224& data-rawheight=&672& class=&origin_image zh-lightbox-thumb& width=&1224& data-original=&https://pic1.zhimg.com/50/420ec1f70c23f795ae0f03b3c0b95f03_r.jpg&&&/figure&&p&&br&&/p&&p&这样我们就完成了删除。&/p&&p&&b&上传与同步&/b&&/p&&p&&b&上传&/b&&/p&&p&此时,当我们打开github网页,就会发现此时你的修改的内容并没有出现在这里。这是因为你没有进行同步,仅仅是在本地就行了修改。此时我们仅仅需要点击右上角的&b&publish&/b&&/p&&figure&&img src=&https://pic4.zhimg.com/50/90a5b3dca47f2dc2bd52f7fccbabe4f5_b.jpg& data-rawwidth=&1224& data-rawheight=&672& class=&origin_image zh-lightbox-thumb& width=&1224& data-original=&https://pic4.zhimg.com/50/90a5b3dca47f2dc2bd52f7fccbabe4f5_r.jpg&&&/figure&&p&&br&&/p&&p&此时你就会本地内容已经上传到网页上。 &/p&&figure&&img src=&https://pic2.zhimg.com/50/1ca0d556a0b27070abbc_b.jpg& data-rawwidth=&1108& data-rawheight=&609& class=&origin_image zh-lightbox-thumb& width=&1108& data-original=&https://pic2.zhimg.com/50/1ca0d556a0b27070abbc_r.jpg&&&/figure&&p&&br&&/p&&p&&b&同步&/b&&/p&&p&当你的代码库上传后就会发现,原来的&b&publish&/b&以及变为了&b&Sync&/b&。
点击&b&Sync&/b&同步代码库!&/p&&p&&br&&/p&&figure&&img src=&https://pic3.zhimg.com/50/ad2dbbecc9cdf_b.jpg& data-rawwidth=&418& data-rawheight=&96& class=&content_image& width=&418&&&/figure&&p&&br&&/p&&p&&br&&/p&&p&&b&分支的使用&/b&&/p&&p&&b&创建分支&/b&&/p&&p&我们创建第一个分支取名为&b&new masterh,&/b&点击&b&Create new branch&/b&创建第一个分支&b&。&/b&&/p&&figure&&img src=&https://pic2.zhimg.com/50/6e539ed50af4c2aa33df4c487a45e462_b.jpg& data-rawwidth=&1224& data-rawheight=&672& class=&origin_image zh-lightbox-thumb& width=&1224& data-original=&https://pic2.zhimg.com/50/6e539ed50af4c2aa33df4c487a45e462_r.jpg&&&/figure&&p&&br&&/p&&p&我们发现此时的分支已经切换到了我们刚刚创建的分支&b&new masterch&/b& 。&/p&&figure&&img src=&https://pic1.zhimg.com/50/3e2f6ffcded2db22baf64ebe_b.jpg& data-rawwidth=&1017& data-rawheight=&257& class=&origin_image zh-lightbox-thumb& width=&1017& data-original=&https://pic1.zhimg.com/50/3e2f6ffcded2db22baf64ebe_r.jpg&&&/figure&&p&&br&&/p&&p&我们来修改&b&new masterch&/b&分支上的内容。 我们仍旧打开&b&FirstDemo.txt&/b&进行编辑。输入以下内容&/p&&blockquote&创建的第一个分支。&/blockquote&&p&打开github进行,填写&b&Summary&/b&和&b&Description&/b&&/p&&figure&&img src=&https://pic3.zhimg.com/50/ba50dfdcbb083b_b.jpg& data-rawwidth=&1224& data-rawheight=&672& class=&origin_image zh-lightbox-thumb& width=&1224& data-original=&https://pic3.zhimg.com/50/ba50dfdcbb083b_r.jpg&&&/figure&&p&&br&&/p&&p&之后我们点击&b&Commit to new-master&/b&在&b&History&/b&目录下,我们可以看到会有两条主线,分别是&b&master&/b&和&b&new-master&/b&并且在&b&new-master&/b&的分支下又一个蓝色的&b&实线空心圈&/b&和一个&b&虚线空心圈&/b&。&/p&&p&&b&实线圈&/b&表示当前的节点,&b&空心圈&/b&表示下一次修改时的节点。&/p&&figure&&img src=&https://pic4.zhimg.com/50/c4e7a44a127cf88c808708_b.jpg& data-rawwidth=&1011& data-rawheight=&162& class=&origin_image zh-lightbox-thumb& width=&1011& data-original=&https://pic4.zhimg.com/50/c4e7a44a127cf88c808708_r.jpg&&&/figure&&p&&br&&/p&&p&&b&红线&/b&标示的部分就是当前的分支 &/p&&figure&&img src=&https://pic2.zhimg.com/50/87fddb750eec11d9d829f7e_b.jpg& data-rawwidth=&343& data-rawheight=&531& class=&content_image& width=&343&&&/figure&&p&&br&&/p&&p&&b&切换分支&/b&&/p&&p&&br&&/p&&p&点击&b&红色&/b&划线部分就会出现分支的列表 &/p&&figure&&img src=&https://pic2.zhimg.com/50/87fddb750eec11d9d829f7e_b.jpg& data-rawwidth=&343& data-rawheight=&531& class=&content_image& width=&343&&&/figure&&p&&br&&/p&&p&我们点击&b&master&/b&就会切换到&b&master&/b&分支。&/p&&p&&br&&/p&&p&&b&上传/同步分支&/b&&/p&&p&这个操作和同步仓库是一个操作,点击&b&Publish/Sync&/b&上传或同步分支。&/p&&p&&b&删除分支&/b&&/p&&p&首先要把分支切换到你要删除的分支下,如我们要删除&b&new master&/b&,将分支切换到&b&new master&/b&&/p&&figure&&img src=&https://pic2.zhimg.com/50/494470bea0eca387f7ca_b.jpg& data-rawwidth=&251& data-rawheight=&352& class=&content_image& width=&251&&&/figure&&p&&br&&/p&&p&点击右上角齿轮就会出现&b&Delete new master&/b& 点击&b&Delete new master&/b&就会弹出一个对话框,询问删除的内容。&/p&&figure&&img src=&https://pic1.zhimg.com/50/815dd8b1c43ca3507580_b.jpg& data-rawwidth=&839& data-rawheight=&249& class=&origin_image zh-lightbox-thumb& width=&839& data-original=&https://pic1.zhimg.com/50/815dd8b1c43ca3507580_r.jpg&&&/figure&&p&&br&&/p&&p&第一个&b&yes ,Delete both&/b&是将本地与网页全部删除;&/p&&p&第二个&b&Delete local only&/b&仅仅是删除本地。&/p&&p&第三个是取消。&/p&&p&&br&&/p&&p&&b&合并两个分支&/b&&/p&&p&将一个分支与&b&master&/b&分支进行合并。 我们首先把分支切换到&b&master&/b&下,点击&b&Update from new-branch&/b&进行分支的合并。&/p&&figure&&img src=&https://pic1.zhimg.com/50/7c763cf71b32fa54cd9c4ad0ad2d340a_b.jpg& data-rawwidth=&1011& data-rawheight=&161& class=&origin_image zh-lightbox-thumb& width=&1011& data-original=&https://pic1.zhimg.com/50/7c763cf71b32fa54cd9c4ad0ad2d340a_r.jpg&&&/figure&&p&&br&&/p&&p&此时我们查看&b&history&/b&目录下就会 &/p&&figure&&img src=&https://pic2.zhimg.com/50/b4ae0cb0b302_b.jpg& data-rawwidth=&1224& data-rawheight=&672& class=&origin_image zh-lightbox-thumb& width=&1224& data-original=&https://pic2.zhimg.com/50/b4ae0cb0b302_r.jpg&&&/figure&&p&&br&&/p&&p&&b&团队协作流程&/b&&/p&&p&&b&认识Flow&/b&&/p&&p&&b&&a href=&//link.zhihu.com/?target=https%3A//guides.github.com/introduction/flow/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&GitHub Flow&/a&&/b&是一个轻量级的,基于分支的工作流程,支持团队和部署在那里的定期做项目。 &/p&&figure&&img src=&https://pic1.zhimg.com/50/cf9c119f8b0d6faa804a8ad44e9bae84_b.jpg& data-rawwidth=&1011& data-rawheight=&391& class=&origin_image zh-lightbox-thumb& width=&1011& data-original=&https://pic1.zhimg.com/50/cf9c119f8b0d6faa804a8ad44e9bae84_r.jpg&&&/figure&&p&&br&&/p&&p&&b&为团队成员写入权限&/b&&/p&&p&在我们的队友添加一个写的权限,这样我们的队友才能很好的修改代码。 我们打开网页上的&a href=&//link.zhihu.com/?target=http%3A//www.github.com/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&GitHub&/a&,点击&b&settings&/b&, &/p&&figure&&img src=&https://pic1.zhimg.com/50/c96b3f7e7e09c01de3b7f7fc_b.jpg& data-rawwidth=&1311& data-rawheight=&680& class=&origin_image zh-lightbox-thumb& width=&1311& data-original=&https://pic1.zhimg.com/50/c96b3f7e7e09c01de3b7f7fc_r.jpg&&&/figure&&p&&br&&/p&&p&之后我们找到&b&collaborators&/b&,这里会让我们验证密码,之后就有添加合作者的选项。&/p&&figure&&img src=&https://pic1.zhimg.com/50/a0ebc9de0de35d7746b6fbb_b.jpg& data-rawwidth=&1037& data-rawheight=&376& class=&origin_image zh-lightbox-thumb& width=&1037& data-original=&https://pic1.zhimg.com/50/a0ebc9de0de35d7746b6fbb_r.jpg&&&/figure&&p&&br&&/p&&p&这样我们就能添加我们的小伙伴了!
这样我们就添加了新的小伙伴,新的小伙伴有着同样的权限去修改和管理代码。 此时我们就会看到我的小伙伴wevan的github主页上就会出现关于我创建的First的各种通知。 &/p&&figure&&img src=&https://pic3.zhimg.com/50/cfbc506bd1b3a2e5d8d48f5_b.jpg& data-rawwidth=&1212& data-rawheight=&670& class=&origin_image zh-lightbox-thumb& width=&1212& data-original=&https://pic3.zhimg.com/50/cfbc506bd1b3a2e5d8d48f5_r.jpg&&&/figure&&p&&br&&/p&&p&&b&创建分支&/b&&/p&&p&在我们创建一个叫&b&add new function&/b&的分支。&/p&&blockquote&创建一个分支 &i&Create a branch&/i& 当你工作的一个项目,你会在任何给定的时间有一堆不同的功能或正在进行的想法 - 其中一些是蓄势待发,而另一些则不是。分支的存在是为了帮助你管理这个工作流程。 &i&When you're working on a project, you're going to have a bunch of different features or ideas in progress at any given time – some of which are ready to go, and others which are not. Branching exists to help you manage this workflow.&/i& 当您在项目中创建一个分支,你创造一个环境,在那里你可以尝试新的想法。你让一个分支的更改不会影响主分支,让你可以自由进行实验,并提交更改,在你的分支将不会被合并,直到它准备好知识安全的人所正在与合作进行审查。 &i&When you create a branch in your project, you're creating an environment where you can try out new ideas. Changes you make on a branch don't affect the master branch, so you're free to experiment and commit changes, safe in the knowledge that your branch won't be merged until it's ready to be reviewed by someone you're collaborating with.&/i& ProTip 分支在Git中是一个核心概念,整个GitHub的流量是基于它。这里只有一个规则:在任何主分支总是部署。 &i&Branching is a core concept in Git, and the entire GitHub Flow is based upon it. There's only one rule: anything in the master branch is always deployable.&/i& 正因为如此,这是非常重要的一个功能或修复工作时,你的新分支关老爷的创建。您的分支名应该是描述(例如,重构的身份验证,用户的内容缓存键,使视网膜-化身),以便其他人可以看到正在处理。 &i&Because of this, it's extremely important that your new branch is created off of master when working on a feature or a fix. Your branch name should be descriptive (e.g., refactor-authentication, user-content-cache-key, make-retina-avatars), so that others can see what is being worked on.&/i&&b&&a href=&//link.zhihu.com/?target=https%3A//guides.github.com/introduction/flow/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&来自GitHub Flow&/a&&/b&&/blockquote&&p&&br&&/p&&p&&b&添加提交&/b&&/p&&figure&&img src=&https://pic4.zhimg.com/50/28d743aa072af18be13eaf_b.jpg& data-rawwidth=&1003& data-rawheight=&374& class=&origin_image zh-lightbox-thumb& width=&1003& data-original=&https://pic4.zhimg.com/50/28d743aa072af18be13eaf_r.jpg&&&/figure&&p&&br&&/p&&p&我们首先把分支切换到新的分支上&b&add new function&/b&&/p&&figure&&img src=&https://pic3.zhimg.com/50/fd8bac4b150ae92c98bc7_b.jpg& data-rawwidth=&300& data-rawheight=&161& class=&content_image& width=&300&&&/figure&&p&&br&&/p&&p&修改新的版本&/p&&figure&&img src=&https://pic2.zhimg.com/50/719dde91f8f_b.jpg& data-rawwidth=&1224& data-rawheight=&672& class=&origin_image zh-lightbox-thumb& width=&1224& data-original=&https://pic2.zhimg.com/50/719dde91f8f_r.jpg&&&/figure&&p&&br&&/p&&p&填写好新的&b&Summary&/b&和&b&Description&/b&,提交新的版本并同步。 这样小伙伴登陆到&b&GitHub&/b&上就看到了就可以清楚的看到一切的修改。 &/p&&blockquote&添加提交 &i&Add commits&/i& 一旦你的分支已经建立,现在是时候开始进行更改。无论何时添加,编辑或删除一个文件,你作出承诺,并将其添加到您的分支。提交加入这一过程保持你的进步轨迹,你在一个特性分支工作。 &i&Once your branch has been created, it's time to start making changes. Whenever you add, edit, or delete a file, you're making a commit, and adding them to your branch. This process of adding commits keeps track of your progress as you work on a feature branch.&/i& 还承诺创建工作的透明历史,其他人可以按照理解你做了什么,以及为什么。每次提交都有一个关联的提交信息,这是解释为什么一个特定的变化作出了说明。此外,每次提交被认为是变革的一个独立单元。这使您可以回滚的变化,如果发现错误,或者如果你决定在一个不同的方向前进。 &i&Commits also create a transparent history of your work that others can follow to understand what you've done and why. Each commit has an associated commit message, which is a description explaining why a particular change was made. Furthermore, each commit is considered a separate unit of change. This lets you roll back changes if a bug is found, or if you decide to head in a different direction.&/i& ProTip&/blockquote&&p&提交信息是重要的,特别是因为Git跟踪更改,然后将它们显示为承诺一旦他们推到服务器。通过字迹清晰提交信息,你可以更容易为其他人跟着,并提供反馈。 &i&Commit messages are important, especially since Git tracks your changes and then displays them as commits once they're pushed to the server. By writing clear commit messages, you can make it easier for other people to follow along and provide feedback.&/i&&b&&a href=&//link.zhihu.com/?target=https%3A//guides.github.com/introduction/flow/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&来自GitHub Flow&/a&&/b&&/p&&p&&br&&/p&&p&&b&打开一个pull请求&/b&&/p&&figure&&img src=&https://pic2.zhimg.com/50/9c66d3ec37a264f4f62580_b.jpg& data-rawwidth=&1014& data-rawheight=&369& class=&origin_image zh-lightbox-thumb& width=&1014& data-original=&https://pic2.zhimg.com/50/9c66d3ec37a264f4f62580_r.jpg&&&/figure&&p&&br&&/p&&p&这个是整个流程中比较关键的一步,发布&b&Pull Request&/b&。&/p&&figure&&img src=&https://pic3.zhimg.com/50/d6b4ace033d32b20fbb4c18e_b.jpg& data-rawwidth=&1134& data-rawheight=&319& class=&origin_image zh-lightbox-thumb& width=&1134& data-original=&https://pic3.zhimg.com/50/d6b4ace033d32b20fbb4c18e_r.jpg&&&/figure&&p&&br&&/p&&p&点击客户端或者网页上的&b&Pull Request&/b&发布。 我们这里点击&b&Pull Request&/b&&/p&&figure&&img src=&https://pic3.zhimg.com/50/235a55e9fe898ccdedb727_b.jpg& data-rawwidth=&1329& data-rawheight=&575& class=&origin_image zh-lightbox-thumb& width=&1329& data-original=&https://pic3.zhimg.com/50/235a55e9fe898ccdedb727_r.jpg&&&/figure&&p&&br&&/p&&p&我们填写好必要的说明性文字 点击&b&Send Pull Request&/b& 他既然让我们到GitHub上看,我们就听他的,点击,进入。 &/p&&figure&&img src=&https://pic3.zhimg.com/50/aa97ff1b02e0ab1f1a274f_b.jpg& data-rawwidth=&1060& data-rawheight=&923& class=&origin_image zh-lightbox-thumb& width=&1060& data-original=&https://pic3.zhimg.com/50/aa97ff1b02e0ab1f1a274f_r.jpg&&&/figure&&p&&br&&/p&&p&我们发现小伙伴已经在下面留言了!&/p&&p&&br&&/p&&p&&b&讨论和审核你的代码&/b&&/p&&figure&&img src=&https://pic3.zhimg.com/50/d85ebb2cb8eab013ce94_b.jpg& data-rawwidth=&973& data-rawheight=&353& class=&origin_image zh-lightbox-thumb& width=&973& data-original=&https://pic3.zhimg.com/50/d85ebb2cb8eab013ce94_r.jpg&&&/figure&&p&&br&&/p&&p&你的小伙伴开始对你的代码讨论,修改,迭代。&/p&&blockquote&讨论和审查你的代码 Discuss and review your code 一旦拉入请求已被打开,人或团队}

我要回帖

更多关于 11086 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信