These code snippets or programs, look smart, or quite practical, worth collecting
Reply content:
Write code, do not test, do not need Beethoven (back multi-points) that year is to not use the endorsement of the computer Ah! (Serious face
This knowledge, is in the process of playing deeply engraved in the mind. Just like a little bit of gas is a small attack, shipped three is the air cannon, deep engraved in the mind AH (what I'm talking about
That year, I think the handwriting prime sieve good cow ah, this must be back down.
Later write more know, Prime sieve, fast power, there is a simple DP search segment tree write more can directly look at the problem knocked out again. When you are familiar with each operator, each of the constants in the algorithm's role, it is very natural to write it in a graceful structure.
When I see Daniel Whiteboard writing algorithms I've never seen before, I'm not as surprised as I used to be. Because I know that it is not recited, he must have paid more than I work in that field.
-----
Collection of course or PyPI best, just copy the words with the module is the most convenient bar from the engineering point of view is to extract enough code, and then find the highest frequency of snippet, such as a row (may be #coding: utf-8) such as more than two lines. Except ...:
Then, it's no use for birds. If there is anything to recite, I think it is the logging configuration. The Lord may want to ask where Python learns to make dread. Standard library usage back, such as the Urllib series, re. And the use of basic objects. Python itself is flexible, and a feature is often written in many ways. I don't think I need to recite.
If you want to say the practical code, you can write it for the first time, then import it directly by importing ... If a code snippet is worth reciting, it will certainly be packaged as a module or package, and you just have to use it. Print (' Hello world! ') Not really. You're going to build your own lib in the future, it's time to import it. Remember some best practices ... You don't have to have an impression on your back.