github上学习Python的前7个存储库

程式设计 (PROGRAMMING)

All roads lead to GitHub.

条条大路通向GitHub。

You may remember a similar article I published called “Top 4 Repositories on GitHub to Learn Pandas”. There, I said I was afraid of using anything more than git commit + git push because GitHub is scary. I’ve progressed a little bit: now I remember to hit git pull every time I have fresh work (instead of screaming internally when I try to push my edits and realize that my local repository wasn’t up to date with the master branch).

您可能还记得我曾发表过一篇类似的文章,名为“ GitHub上学习熊猫的四大知识库 ”。 在那儿,我说我害怕使用除git commit + git push之外的任何东西,因为GitHub令人恐惧。 我取得了一些进展:现在我记得每次有新工作时都按git pull (而不是在尝试推送编辑并意识到我的本地存储库未与master分支保持最新时在内部尖叫) 。

This time, I decided to compile a similar list of learning resources for Python! Some of them contain tutorial-style Jupyter notebooks, whereas others feature extensive collections of programming problems. All of them have the potential to be useful, depending on your preferred learning style.

这次,我决定为Python编写一份类似的学习资源清单! 其中一些包含教程风格的Jupyter笔记本,而另一些则包含大量的编程问题。 根据您偏爱的学习方式,所有这些都有可能有用。

If you haven’t used Python at all before, you may benefit from the repositories that have resources for complete beginners. If you’re already comfortable with Python and you’re looking to brush up on a particular subject, say algorithms, there’s also a repository just for you!

如果您以前从未使用过Python,那么您可能会从拥有适合初学者的资源的存储库中受益。 如果您已经对Python感到满意,并且希望重新学习某个特定的主题(例如算法),那么还有一个适合您的存储库!

Learn-python3 —中级入门(1.8k星) (learn-python3 — Beginner to Intermediate (1.8k stars))

Image for post
learn-python-3 on GitHub by jerry-git
GitHub上的 learning- python-3 ,作者 jerry-git

This repository takes you through 19 Jupyter notebooks in its beginner section. It covers foundation-level like strings and conditionals, then goes a bit deeper by discussing classes (a really quick introduction to object-oriented programming), exceptions (what they are and how to handle them), and some features included in the Python standard library (datetime, regular expressions, and more).

该存储库在其初学者部分带您浏览19个Jupyter笔记本。 它涵盖了诸如字符串和条件之类的基础级别,然后通过讨论类(对面向对象编程的快速介绍),异常(它们是什么以及如何处理它们)以及Python标准中包含的某些功能来进行更深入的介绍。库(日期时间,正则表达式等)。

Each topic has a “notebook” link, which brings you to an introduction of the topic and some sample code. After you go through that, there’s an “exercise” link, which takes you to a notebook with sample problems that you can fill in and test.

每个主题都有一个“笔记本”链接,可为您介绍该主题和一些示例代码。 完成此操作后,将有一个“练习”链接,可将您带到笔记本电脑,其中包含您可以填写和测试的示例问题。

Image for post
exercise notebook from jerry-git的示例 jerry-git 运动笔记本

Then, there’s an intermediate “idiomatic” section. This section describes “Pythonic features”, which are features in Python that aren’t present in many other programming languages. If you’re already familiar with a different language, you may want to check this section out for tips and tricks on working specifically with Python. For example, there’s a section on how to approach loops in Python differently than with other languages.

然后,有一个中间的“惯用语”部分。 本节介绍“ Python功能”,这是Python中许多其他编程语言所没有的功能。 如果您已经熟悉另一种语言,则可能需要查看本节以获取有关专门使用Python的提示和技巧。 例如,有一节专门介绍如何以不同于其他语言的方式处理Python中的循环。

Image for post
idiomatic notebook from jerry-git的示例 jerry-git 惯用笔记本

This repository also has a link to a handy “best practices” notebook, which you can use to learn about what practices you should implement when creating Python projects. It covers things like setting up a virtual environment with pipenv and using pytest for (you guessed right) testing.

该存储库还具有指向方便的“最佳实践”笔记本的链接,您可以使用该笔记本来了解创建Python项目时应实施哪些实践。 它涵盖的东西就像建立一个虚拟的环境pipenv和使用pytest对(你猜对了)测试。

Learn-python —中级入门(3.9k星) (learn-python — Beginner to Intermediate (3.9k stars))

Image for post
learn-python on GitHub by trekhleb在GitHub上 trekhleb 学习Python

This repository also serves as an introduction to Python that can bring you from beginner to intermediate (and by intermediate I mean comfortable with using the language beyond simple loops and arithmetic). Instead of using notebooks, the repository is a collection of Python scripts, each of which is a sub-topic of a core category like “Operators”, “Data Types”, and “Control Flow”.

该存储库还可以作为Python的介绍,它可以使您从初学者到中级(而中级的意思是我喜欢使用简单循环和算术之外的语言)。 该存储库不是使用笔记本,而是Python脚本的集合,每个脚本都是核心类别(如“操作员”,“数据类型”和“控制流”)的子主题。

Image for post
Sample sub-topic Python file by trekhleb的 trekhleb 样本子主题Python文件

Each Python file demonstrates the sub-topic in question as well as a helpful link that you can visit for more information. This can be helpful if you’re unclear on what the code does and need to quickly review some theory.

每个Python文件都演示了相关的子主题,以及您可以访问以获取更多信息的有用链接。 如果您不清楚代码的功能并且需要快速回顾一些理论,这将很有帮助。

Two important features included in the repository as you work with the Python files are testing and style checking. You can see the full details under “How to Use This Repository”, but for testing, the author includes lines with assert at the bottom of the main function to see if the function is performing as it should. This can be useful if you want to make changes to the code and see if it still functions properly. There are instructions for how you can actually run the tests with pytest. Also, to get into a habit of following Python’s main style guide (PEP 8), there are further instructions for you to run pylint on the code to see if the Python files comply with the style guide.

使用Python文件时,存储库中包含的两个重要功能是测试和样式检查。 您可以在“如何使用此存储库”下看到完整的详细信息,但是为了进行测试,作者在主函数的底部添加了带有assert行,以查看该函数是否按预期运行。 如果您想更改代码并查看其是否仍然正常运行,这将很有用。 有关如何使用pytest实际运行测试的pytest 。 另外,为了养成遵循Python主要样式指南(PEP 8)的习惯,还有进一步的说明供您在代码上运行pylint ,以查看Python文件是否符合样式指南。

You don’t have to follow the course in its entirety, as the author notes that you can also use the repository as a cheat-sheet. You could simply find the section you’re looking for, review the documentation, play around with the code, then run tests and lint the code to see if it’s working and written as it should be.

正如作者指出的那样,您不必完全遵循该课程,因为您还可以将存储库用作备忘单。 您可以简单地找到所需的部分,查看文档,使用代码,然后运行测试并整理代码,以查看其是否正常工作和编写。

全速python-中级入门(2.6k星) (full-speed-python — Beginner to Intermediate (2.6k stars))

Image for post
full-speed-python on GitHub by joaoventura
GitHub上的 全速 python by joaoventura

This repository features a book that quickly goes through the basics of strings and lists, then dives quickly into relatively more advanced topics like “Classes”, “Coroutines” and “Asynchronous Programming”. The author wrote the book with a practical approach in mind, briefly introducing each topic with code examples and then jumping straight to practice problems that readers can try on their own.

该资料库的特色是一本书,该书快速讲解了字符串和列表的基础知识,然后Swift跳入了相对更高级的主题,例如“类”,“协程”和“异步编程”。 作者在编写本书时就牢记了实用的方法,并通过代码示例简要介绍了每个主题,然后直接跳到练习读者可以自己尝试的问题。

You can either download the pdf/epub file from the link the Readme, or you can clone the repository and build it yourself.

您可以从自述文件链接下载pdf / epub文件,也可以克隆存储库并自行构建。

The author writes that “Distributed Computing students taking a software engineering degree became familiar with Python in two weeks and could implement a distributed client-server application with sockets in the third week”. If you already have some software engineering experience in another language, or if this isn’t your first programming language, using this book may help quickly get you up to speed with Python.

作者写道:“拥有软件工程学位的分布式计算专业的学生在两周内就熟悉了Python,并在第三周内可以使用套接字实现分布式客户端-服务器应用程序”。 如果您已经具有另一种语言的软件工程经验,或者这不是您的第一门编程语言,那么使用本书可以帮助您快速掌握Python。

python_reference —中级(2.3k星) (python_reference — Intermediate (2.3k stars))

Image for post
python_reference on GitHub by rasbt在GitHub上的 rasbt python_reference

This repository is not a tutorial-style resource with groups of concepts like the previous repositories. Instead, this repository is more of a collection of different notebooks on intermediate-level topics like “SQLite database operations in Python” and “Parallel processing via the multiprocessing module”. If you already have a solid foundation in Python, this resource may be useful to help you really take advantage of different features of the language. As with the previous repositories, this one also includes notebooks with code that you can edit and run.

该存储库不是教程风格的资源,它没有像以前的存储库那样的概念组。 取而代之的是,该存储库更多地是关于中级主题(如“ Python中SQLite数据库操作”和“通过多处理模块的并行处理”)的不同笔记本的集合。 如果您已经在Python上拥有坚实的基础,那么此资源可能对帮助您真正利用该语言的不同功能很有用。 与以前的存储库一样,该存储库还包括带有可编辑和运行代码的笔记本。

Image for post
Sample tips notebook by RASBT的 rasbt 示例提示笔记本

The aptly named “not so obvious Python stuff” notebook (snippet above) gives a rundown of various Python and Python module features that you may not have learned while studying the absolute basics. You never know when that random tip could help your work in the future. While it’s great to build depth of understanding when you’re just starting with Python, once you’ve learned enough of the basics, it can help to go through a compilation of unrelated tips like to broaden and fill gaps in your knowledge.

恰当命名的“不太明显的Python东西”笔记本(如上代码段)简要介绍了各种Python和Python模块功能,这些功能在学习绝对基础知识时可能没有学过。 您永远不会知道随机提示何时可以帮助您将来的工作。 当您刚开始使用Python时,建立深度的理解是很棒的,但是一旦您掌握了足够的基础知识,它就可以帮助您整理不相关的技巧,例如扩大和填补知识方面的空白。

There are also helpful non-code resources which the author has linked to which serve more as “theory resources”. For example, the author created one called “Unit testing in Python — Why we want to make it a habit”.

作者还链接了有用的非代码资源,这些资源更多地充当“理论资源”。 例如,作者创建了一个名为“ Python中的单元测试-为什么我们要养成习惯”。

Image for post
Sample theory resource by rasbt的 rasbt 样本理论资源

The author has also linked many other external resources they found useful for learning Python, including forums, books, and existing Python projects. The r/Python on Reddit, for example, is a great place to find helpful Python tips as well as personal projects that community members showcase.

作者还链接了他们发现对学习Python有用的许多其他外部资源,包括论坛,书籍和现有的Python项目。 例如,Reddit上的r / Python是找到有用的Python技巧以及社区成员展示的个人项目的好地方。

Python编程练习—从入门到高级(10.8k星) (Python-programming-exercises — Beginner to Advanced (10.8k stars))

Image for post
Python-programming-exercises on GitHub by zhiwehu在GitHub上进行 zhiwehu Python-programming-exercises

This repository currently features one hundred Python programming exercises, ranging from beginner to advanced in difficulty. The questions and solutions were originally written in Python 2, but the author has since updated all 100 questions to include solutions written in Python 3.

该存储库当前具有一百个Python编程练习,范围从初学者到高级难度。 这些问题和解决方案最初是用Python 2编写的,但是此后作者更新了所有100个问题,以包括用Python 3编写的解决方案。

Image for post
Sample exercises by zhiwehu的 zhiwehu 示例练习

If you’re already familiar with Python, some of these questions may seem too easy. I’d say being able to solve the easy questions is one thing, but being able to whiz through them is another. Going through all these problems, maybe in tandem with an online course you follow or the resources from one of the GitHub repositories here, can help prepare train you to solve programming exercises.

如果您已经熟悉Python,那么其中一些问题似乎太简单了。 我会说能够解决简单的问题是一回事,而能够解决这些问题则是另一回事。 解决所有这些问题,可能与您遵循的在线课程或此处的GitHub存储库中的资源一起进行,可以帮助培训您解决编程练习。

If you get stuck, you can use the “hint” line present at every problem to try and figure out how to approach the problem. Try not to scroll too far down for each question so you don’t see the solution right away because the process of trying to figure out the solution to a problem help you really remember the solution (instead of just trying to read and memorize the solution).

如果您陷入困境,则可以使用每个问题出现的“提示”行来尝试找出解决问题的方法。 尽量不要将每个问题向下滚动得太远,这样您就不会马上看到解决方案,因为尝试找出问题的解决方案的过程可以帮助您真正记住解决方案(而不是仅仅阅读并记住解决方案)。

Image for post
Sample exercises by zhiwehu的 zhiwehu 示例练习

There’s also an “extended version” of this repository by a different author with the same questions and alternate solutions. In this extended repository, the author attempts to show the different ways one problem could be solved, which may be more efficient or “Pythonic” than the original solution.

由不同的作者针对相同的问题和替代解决方案,该存储库还有一个“扩展版本”。 在这个扩展的存储库中,作者试图展示解决问题的不同方法,这可能比原始解决方案更有效或“ Pythonic”。

Image for post
Sample exercises by Darkprinx的 darkprinx 示例练习

编码问题—中级到高级(2.6k星) (coding-problems — Intermediate to Advanced (2.6k stars))

Image for post
coding-problems on GitHub by MTrajK在GitHub上的 MTrajK 编码问题

Just like the previous repository, this one contains a comprehensive list of programming and algorithmic exercises that you can solve. However, instead of having all the exercises in a notebook, this repository has a Python file for each exercise, with a description of the problem and then what a solution for it would look like.

就像以前的存储库一样,该存储库包含您可以解决的编程和算法练习的完整列表。 但是,不是将所有练习都放在笔记本中,而是该存储库为每个练习提供一个Python文件,其中包含问题的说明以及解决方案。

Image for post
Sample exercise by MTrajK的 MTrajK 样本练习

These questions don’t start at a complete beginner level of difficulty, so I would suggest coming to these once you already have a solid grasp of the basics (using functions, control flow, etc.).

这些问题并不是从完全的初学者难度开始的,因此,我建议一旦您已经扎实地掌握了基础知识(使用功能,控制流程等),就开始讨论这些问题。

The author also writes that “algorithms and structures and not language-specific”. Because of this, he wrote the solutions in Python because of the language’s readability, but people comfortable in other languages should be able to use this repository as well to see how to approach algorithmic problems.

作者还写道:“算法和结构而不是特定于语言的”。 因此,由于该语言的可读性,他用Python编写了解决方案,但是熟悉其他语言的人们也应该能够使用此存储库,以了解如何解决算法问题。

The problems in this repository are not written originally by the author, as he explicitly states that they come from problem-solving sites like LeetCode. His contribution is providing solutions and explanations to help people learn how to solve these types of problems.

该存储库中的问题并非最初由作者编写,因为他明确指出它们来自诸如LeetCode之类的问题解决站点。 他的贡献是提供解决方案和解释,以帮助人们学习如何解决这些类型的问题。

You’ll find that many problems can be grouped under a one main topic, so the approach to solving those problems may be somewhat similar. As you keep practicing the same types of problems in one topic, you should find that they become progressively easier for you to solve.

您会发现许多问题可以归为一个主要主题,因此解决这些问题的方法可能有些相似。 当您在一个主题中练习相同类型的问题时,您应该发现它们逐渐变得更容易解决。

In addition to the Python files with algorithm questions and solutions, he also includes a comprehensive list of other resources for you to use. There are many online courses, recommended books, and links to popular sites for programming problems.

除了带有算法问题和解决方案的Python文件之外,他还提供了可供您使用的其他资源的完整列表。 有许多在线课程,推荐书籍,以及有关编程问题的流行网站的链接。

TheAlgorithms —中级到高级(82.4k星) (TheAlgorithms — Intermediate to Advanced (82.4k stars))

Image for post
Python on GitHub by Python by TheAlgorithms TheAlgorithms

This repository also features a collection of files that show you how different algorithms can be implemented in Python. These algorithms are grouped into categories from “Arithmetic Analysis” to “Blockchain” to “Data Structures” and even more. There isn’t as much explanation on how to solve each problem, as this repository can serve as a solution guide to implementing different algorithms.

该存储库还具有一系列文件,这些文件向您展示如何在Python中实现不同的算法。 这些算法分为从“算术分析”到“区块链”再到“数据结构”甚至更多的类别。 关于如何解决每个问题的解释不多,因为此存储库可以用作实现不同算法的解决方案指南。

Image for post
Sample algorithm solution by TheAlgorithms的 TheAlgorithms 示例算法解决方案

Some files do give you a bit of context (and a link or two to get you started), but you may have to do some research on your own before you try to solve these algorithms. If you’re completely new to Python, I would suggest building your fundamental knowledge first, as this repository is really for those that are already comfortable with the language and are looking to deepen their knowledge on algorithms.

某些文件确实为您提供了一些上下文信息(以及一个或两个链接可以帮助您入门),但是在尝试解决这些算法之前,您可能必须自己做一些研究。 如果您是Python的新手,我建议您首先构建基础知识,因为此存储库确实适合那些已经熟悉该语言并希望加深他们对算法知识的人。

The author has also created similar “learning algorithms” repositories for a few other major languages (Java, C++, C, Go, Javascript), which you can check out on the profile’s pinned repositories.

作者还为其他几种主要语言(Java,C ++,C,Go,Javascript)创建了类似的“学习算法”存储库,您可以在配置文件的固定存储库中进行检查。

GitHub repositories contain a wealth of valuable learning resources, but that doesn’t mean you need to use all of them. My suggestion is to first take one of the “beginner to intermediate” type repositories and work through all the learning material in it. You should work through the repository that best fits your learning style. For example, if you want to learn through editable Jupyter notebooks that take you from basic to intermediate topics, you should try the first repository in this piece.

GitHub存储库包含大量有价值的学习资源,但这并不意味着您需要使用所有这些资源。 我的建议是首先采用“初学者到中级”类型的存储库之一,并研究其中的所有学习资料。 您应该研究最适合您的学习风格的资源库。 例如,如果您想学习从基础主题到中级主题的可编辑Jupyter笔记本,则应尝试使用本部分中的第一个存储库。

In addition, the two 100+ Python problems are great for you to use as an introduction to solving programming problems. You can choose to either start trying a few every day or wait until you have a more solid foundation in Python first. These can eventually help you build some basic knowledge for the types of programming questions that could come up in technical job interviews. You could progress from these to sites like HackerRank and LeetCode, which also give you various programming problems to solve every day. They can also help you prepare for job interviews at specific companies, like Facebook, Amazon, and Google.

此外,两个100+ Python问题非常适合您作为解决编程问题的入门。 您可以选择每天开始尝试几次,也可以等到首先有了更扎实的Python基础。 这些最终可以帮助您建立一些技术性面试中可能遇到的编程问题类型的基础知识。 您可以从这些站点升级到HackerRank和LeetCode之类的站点,这些站点还为您每天解决各种编程问题。 他们还可以帮助您准备在特定公司(如Facebook,Amazon和Google)进行面试。

Learning Python (and anything really) is all about staying motivated and practicing. Python isn’t magic- make a plan and use one of these repositories if they fit (or use something completely different if they don’t) and stick with it.

学习Python(以及其他任何东西)都是关于保持动力和练习。 Python并非魔术师-制定计划并在适合的情况下使用其中一个存储库(如果不适合,则使用完全不同的存储库)并坚持使用

You got this!

你明白了!

翻译自: https://towardsdatascience.com/top-7-repositories-on-github-to-learn-python-44a3a7accb44

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值