gregmalcolm/python_koans là một trong những repo phía máy chủ mà TopGit theo dõi, hiện có 5.1k sao, viết chủ yếu bằng Python. Python Koans - Learn Python through TDD
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Python Koans is an interactive tutorial for learning the Python programming
language by making tests pass.
Most tests are fixed by filling the missing parts of assert functions. Eg:
.. code-block:: python
self.assertEqual(__, 1+2)
which can be fixed by replacing the __ part with the appropriate code:
.. code-block:: python
self.assertEqual(3, 1+2)
Occasionally you will encounter some failing tests that are already filled out.
In these cases you will need to finish implementing some code to progress. For
example, there is an exercise for writing some code that will tell you if a
triangle is equilateral, isosceles or scalene.
As well as being a great way to learn some Python, it is also a good way to get
a taste of Test Driven Development (TDD).
Downloading Python Koans
Python Koans is available on GitHub:
https://github.com/gregmalcolm/python_koans
You can clone with Git or download the source as a zip/gz/bz2.
Installing Python Koans
Aside from downloading or checking out the latest version of Python Koans, you
need to install the Python interpreter.
At this time of writing, we support Python 3. The policy is to try to keep
current with the latest production version.
You should be able to work with newer Python versions, but older ones will
likely give you problems.
You can download Python from here:
https://www.python.org/downloads/
After installing Python make sure the folder containing the python executable
is in the system path. In other words, you need to be able to run Python from a
command console. It will either be python3 or for Windows it will be python.exe.
If you have problems, this may help:
https://www.python.org/about/gettingstarted/
Windows users may also want to update the line in the batch file run.bat to
set the python path::
SET PYTHON_PATH=C:\Python39
Getting Started
Jake Hebbert has created a couple of screencasts available here:
It also tells me exactly where the problem is, it's an assert on line 12
of .\\koans\\about_asserts.py. This one is easy, just change False to True to
make the test pass.
Sooner or later you will likely encounter tests where you are not sure what the
expected value should be. For example:
Sniffer allows you to run the tests continuously. If you modify any files files
in the koans directory, it will rerun the tests.
To set this up, you need to install sniffer:
.. code-block:: sh
python3 -m pip install sniffer
You should also run one of these libraries depending on your system. This will
automatically trigger sniffer when a file changes, otherwise sniffer will have
to poll to see if the files have changed.
On Linux:
.. code-block:: sh
python3 -m pip install pyinotify
On Windows:
.. code-block:: sh
python3 -m pip install pywin32
Also available here:
https://github.com/mhammond/pywin32/releases
On macOS:
.. code-block:: sh
python3 -m pip install MacFSEvents
Once it is set up, you just run:
.. code-block:: sh
sniffer
Just modify one of the koans files and you'll see that the tests are triggered
automatically. Sniffer is controlled by scent.py.
Getting the Most From the Koans
Quoting the Ruby Koans instructions:
"In test-driven development the mantra has always been, red, green,
refactor. Write a failing test and run it (red), make the test pass
(green), then refactor it (that is look at the code and see if you
can make it any better). In this case you will need to run the koan
and see it fail (red), make the test pass (green), then take a
moment and reflect upon the test to see what it is teaching you
and improve the code to better communicate its intent (refactor)."
Finding More Koan Projects
There are number of other great Koan projects out there for various languages
and frameworks. Most of them can be found in GitHub. Also there is a little
koans activity on Bitbucket.
Translations are always welcome! Feel free to add one to this README
if you happen to work on one:
https://github.com/mswell/python_koans_br
Acknowledgments
Thanks go to Jim Weirich and Joe O'Brien for the original Ruby Koans that the
Python Koans is based on! Also the Ruby Koans in turn borrows from Metakoans
so thanks also go to Ara Howard for that!
Also thanks to everyone who has contributed to Python Koans! I got a great
headstart by taking over a code base initiated by the combined Mikes of
FPIP. So here's a little plug for their very cool Python podcast:
https://www.frompythonimportpodcast.com/
A big thanks also to Mike Pirnat @pirnat and Kevin Chase @kjc have pitched in
as co-maintainers at various times
gregmalcolm/python_koans thuộc nhóm Backend trên TopGit, cùng 2 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về gregmalcolm/python_koans ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/gregmalcolm/python_koans là nguồn chính thức.
gregmalcolm/python_koans có bao nhiêu sao?
gregmalcolm/python_koans có 5.1k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/gregmalcolm/python_koans. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
gregmalcolm/python_koans có phải mã nguồn mở không?
Có — gregmalcolm/python_koans phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/gregmalcolm/python_koans.
gregmalcolm/python_koans có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho gregmalcolm/python_koans. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
gregmalcolm/python_koans là gì?
gregmalcolm/python_koans (gregmalcolm/python_koans) là dự án Python trên GitHub. Theo mô tả gốc: Python Koans - Learn Python through TDD
gregmalcolm/python_koans so với các dự án Backend khác thế nào?
gregmalcolm/python_koans được TopGit xếp vào nhóm Backend, với 5.1k sao GitHub và viết bằng Python. Xem trang chủ đề Backend trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về python_koans?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về python_koans.