This week there were not enough large small joys, but there were 3 very small small joys.
It is now customary to supply your libraries and repos on github with beautiful animations showing the console with a live demo of your creation.
The tradition is undoubtedly good and correct. Only to record such animations is difficult / lazy / there is no time. The authors of termtosvg shot all the rabbits with a single shot and gave the programmers a great piece for recording console demos.
Unlike many other solutions, termtosvg does not write video or gif. This thing catches everything happening in the console and renders SVG animation based on what appears in the terminal. At the output, you do not get the animation of your screen, but a beautiful and stylish render of console operations. SVG weighs much less than other formats, and yet it can be edited quite easily.
For the discerning people, several preset colors are included so that you can customize your live demos.
You can render the output in a light theme:
You can render in such a dark theme, with the window control buttons and the progress bar below:
And you can still dozens of other colors.
Everything is put as usual
pip install termtosvg
makovods can also be delivered via brew (the necessary versions of Python and another dependency pack will be pulled up by itself)
brew install termtosvg
The manual is here , the full list of pre-installed render themes is here . All of this is in Python, so you can at least read interesting sources, if you don’t need any console animations.
The Algorithms in Python. This repo has already been seen by many and he is well known - almost 50,000 stars on github. Implementing a bundle of classic algorithms in pure Python — graphs, math, encryption, protocols, network routing, and a whole bunch of different things.
For everyday work, this will take very few people, but it will be very useful for general development or for preparing for an interview with a company that may offer you to work with a binary tree at an interview.
There are not only pitonachye implementations, but also other languages .
It would seem that the tools for debugging and monitoring the pitonach code are complete and they satisfy all the needs of the developer — debuggers, log collectors, error monitoring, metrics collectors.
But sometimes it happens that the engineers have to spank in the code of the good old print()
to understand what is happening.
if something: print(1) operation_one() else: print(2) operation_two()
The debugging method is controversial, dirty, effective and on the amateur. For such fans, there is the icecream python library (and also implementations for C ++, Node.JS, Rust, Dart and PHP).
Now you can write
from icecream import ic def foo(): ic() first() if expression: ic() second() else: ic() third()
and get in response a debugging code like
ic| example.py:4 in foo() ic| example.py:11 in foo()
For debugging cleanly with such a method, I personally would have punched it in the neck, but with certain modifications it can be used. Even in this lib there is something else that can be useful:
If this is all neatly combined with different switch flags from debug mode to production mode, then it turns out to be quite a sane thing that will tell you everything that is happening in your code.
Source: https://habr.com/ru/post/459074/
All Articles