Compare commits
410 Commits
Author | SHA1 | Date |
---|---|---|
Satwik Kansal | d2673bba08 | |
Vadim Nifadev | be4811aeb7 | |
Satwik Kansal | 77af92f780 | |
Satwik Kansal | 394fa09b07 | |
Satwik Kansal | b251f1b150 | |
Jeremy Cheng | c7f3849c1a | |
Vadim Nifadev | d70bf71cb6 | |
Vadim Nifadev | 8db7d48ad6 | |
Vadim Nifadev | 39595fc35f | |
Vadim Nifadev | b6fd12efa2 | |
Vadim Nifadev | 0ec5939713 | |
Vadim Nifadev | 19fba38556 | |
Vadim Nifadev | 16628ba071 | |
Vadim Nifadev | b1684aaf39 | |
Vadim Nifadev | 6f35f00461 | |
Vadim Nifadev | a2c5a17ca8 | |
Vadim Nifadev | fcb70ba7b9 | |
Vadim Nifadev | 9687de2a67 | |
Vadim Nifadev | d0dd3ad2b7 | |
Vadim Nifadev | 5bbdcdd5a5 | |
Vadim Nifadev | 2c623dd33a | |
Vadim Nifadev | f0afccc347 | |
Vadim Nifadev | d7d7e970d7 | |
Vadim Nifadev | 05ad6cf2af | |
Vadim Nifadev | f71b997a45 | |
Vadim Nifadev | 9e2508ae6a | |
Vadim Nifadev | 4b4951d755 | |
Vadim Nifadev | 00e420fc51 | |
Vadim Nifadev | ebe5f59a9d | |
Vadim Nifadev | 551b251c05 | |
Vadim Nifadev | eab5d5968e | |
Vadim Nifadev | a5f1258275 | |
Vadim Nifadev | b5c20d02ea | |
Vadim Nifadev | 3b9d9bdcd1 | |
Vadim Nifadev | be9c3bb0ae | |
Vadim Nifadev | 193c839163 | |
Vadim Nifadev | 664bb038d4 | |
Vadim Nifadev | e2d0be0e2a | |
Vadim Nifadev | 8ab55b7393 | |
Vadim Nifadev | 124b0f027d | |
Vadim Nifadev | 662b720b5c | |
Vadim Nifadev | 039adfa04a | |
Vadim Nifadev | f84272fc5c | |
Vadim Nifadev | 8f60bc1d0b | |
Vadim Nifadev | bbb086a521 | |
Vadim Nifadev | 2043112a9d | |
Vadim Nifadev | 0d28d47f08 | |
Vadim Nifadev | a25fe26adc | |
Vadim Nifadev | 40503d5ac5 | |
Vadim Nifadev | c2dd151ed5 | |
Vadim Nifadev | 7ce56da1d8 | |
Vadim Nifadev | 473e4229f2 | |
Vadim Nifadev | 3df9d0e4e3 | |
Vadim Nifadev | e8cd593e62 | |
Vadim Nifadev | 2aa7b37540 | |
Vadim Nifadev | b1a8aadd70 | |
Vadim Nifadev | eccd68a4bd | |
Vadim Nifadev | 3fc9e9e028 | |
Vadim Nifadev | c125f25fb5 | |
Vadim Nifadev | f96f5117c5 | |
Vadim Nifadev | 58de881f93 | |
Vadim Nifadev | f2b1d7e8c2 | |
Vadim Nifadev | 495c840254 | |
Vadim Nifadev | 51d13b87cf | |
Vadim Nifadev | ecaab6dca1 | |
Vadim Nifadev | 972d1334fb | |
Vadim Nifadev | a0069d842e | |
Vadim Nifadev | 8a1536986f | |
Vadim Nifadev | 5eeb1053aa | |
Vadim Nifadev | 293575b7c4 | |
Vadim Nifadev | 191ea8343b | |
Vadim Nifadev | 6e246d1487 | |
Vadim Nifadev | a32eaca58f | |
Vadim Nifadev | 446a3a09bb | |
Vadim Nifadev | 4576463fcc | |
Vadim Nifadev | 361ac5f49b | |
Vadim Nifadev | 497b9de72b | |
Vadim Nifadev | 259fb23c7b | |
Vadim Nifadev | 654da92e88 | |
Vadim Nifadev | 83bdff8e33 | |
Vadim Nifadev | 47fa96c31a | |
Vadim Nifadev | 2840050acb | |
Vadim Nifadev | a7985b9edc | |
Vadim Nifadev | e2d6ee66cc | |
Vadim Nifadev | c91a6073fb | |
Vadim Nifadev | 86140390ad | |
Vadim Nifadev | b5b8b83c0a | |
Vadim Nifadev | 489ccb18a7 | |
Vadim Nifadev | 57987cc9d5 | |
Satwik Kansal | 86e78697fb | |
Sean | 1b1b9d4b70 | |
Satwik Kansal | 19d4b07515 | |
Raigorx Hellscream | ab82f9647c | |
Satwik Kansal | f32e9d36e3 | |
Satwik Kansal | 6010b97d90 | |
Francisco Couzo | acfcfa8808 | |
Satwik Kansal | ccf5be1a6f | |
Satwik Kansal | a50839656c | |
Satwik Kansal | f5f5208b12 | |
Satwik Kansal | ea1e228407 | |
Alexander Mayorov | d8258dbc96 | |
Satwik Kansal | 6a4cd34413 | |
Alexander Mayorov | feeb410009 | |
Satwik Kansal | 6213399144 | |
jeffreykennethli | d3a25fa14e | |
Satwik Kansal | e9a49a5527 | |
Matt Kohl | be377779b6 | |
Satwik Kansal | fe9ed47217 | |
Satwik Kansal | 00c5503712 | |
Satwik Kansal | cd4d7c0e34 | |
Satwik Kansal | c8f300fd09 | |
flencydoc | 205c9ede01 | |
Satwik Kansal | f4f501a230 | |
bwduncan | 043b83a722 | |
Satwik Kansal | 2e2d65a9ec | |
Satwik Kansal | 086be4ed19 | |
Satwik Kansal | 9fc6db6215 | |
Satwik Kansal | 897b915f11 | |
LiquidFun | 6642876c64 | |
Satwik Kansal | b89710a415 | |
sonlhcsuit | aaa74c46a7 | |
Satwik Kansal | 1787b50422 | |
Sam Benner | 5525591601 | |
Satwik Kansal | bfccb718de | |
José De Freitas | 95a87484c5 | |
José De Freitas | 6e187cf84b | |
Satwik Kansal | d6ba3a66a3 | |
Chris Milson | f0bd1cb481 | |
Satwik Kansal | 70c03e9801 | |
Umutambyi Gad | 9d0ad9ed98 | |
Satwik Kansal | 48256e1fe8 | |
abdo | de4b851c72 | |
Satwik | 048a620502 | |
Satwik | 2bc1cd61c1 | |
Vitor Santa Rosa | d06fcbff1b | |
Satwik Kansal | c954b71f67 | |
Yonatan Goldschmidt | 314de9a30b | |
Yonatan Goldschmidt | f13b98e6d5 | |
Satwik Kansal | 902ca179eb | |
Satwik Kansal | 9c42b920ad | |
Satwik Kansal | bb8ce63f68 | |
谭九鼎 | ac63a4fb3a | |
谭九鼎 | c824ed7813 | |
谭九鼎 | e5b519149d | |
谭九鼎 | 435fd5f49e | |
Satwik Kansal | f082e9f22a | |
Satwik Kansal | 33bcfa744a | |
Diptangsu Goswami | 7525e800b8 | |
Satwik Kansal | 9b3f86958a | |
AmitShinde | d4ad5a0643 | |
Satwik Kansal | 9e28e00123 | |
Satwik Kansal | 27b66b4f31 | |
Satwik Kansal | 19e6b7da57 | |
Vladislav Glinsky | be2d537a05 | |
Satwik | 7d06e7b5c1 | |
Satwik Kansal | a3baf043bd | |
Satwik Kansal | 03a035a89d | |
Yonatan Goldschmidt | 87906b9b2f | |
Yonatan Goldschmidt | ee0696b676 | |
Satwik | f72d7325fa | |
Satwik | ee70d52fe4 | |
Satwik | f97cbdd919 | |
Satwik Kansal | 098d71f348 | |
Yonatan Goldschmidt | 0b74f9ba5d | |
Satwik Kansal | 7457ffb848 | |
Satwik | 3ba87fea65 | |
Satwik | 32f14a7e16 | |
Satwik Kansal | 14600fd19b | |
Satwik Kansal | 5edef33cae | |
Joachim Strömbergson | 9ff40de544 | |
Satwik Kansal | 0684777fa3 | |
zenglifa@msu.edu | f735fe3116 | |
Satwik Kansal | 669ff8c30e | |
Yonatan Goldschmidt | 67f743eddd | |
myrmica-habilis | 78cb5f39f5 | |
Satwik Kansal | e9b04d33f7 | |
Satwik Kansal | 733061f90d | |
Pradhvan | 184df9f99d | |
Haksell | a4af8a4e0c | |
Haksell | 50265e91fc | |
Satwik Kansal | 6cebc952c3 | |
Satwik Kansal | bd7cd4334c | |
Satwik Kansal | 97c10e6fda | |
Satwik Kansal | 8e6c850f30 | |
Satwik Kansal | e74ccb79d0 | |
Satwik Kansal | daf156abf5 | |
Lars Kellogg-Stedman | 16c90f9b24 | |
Lars Kellogg-Stedman | 3e99005ae4 | |
Lars Kellogg-Stedman | 8370f3a3b9 | |
Lars Kellogg-Stedman | f20be4cfc4 | |
Lars Kellogg-Stedman | 00a1228ca3 | |
Satwik Kansal | de113d2491 | |
Satwik Kansal | ffb1599458 | |
Antoine Rozo | 5f8067df42 | |
Arthur Pastel | 30a6623ccd | |
Satwik Kansal | 83cac75f41 | |
Kerollos Magdy | d1a4144143 | |
Satwik Kansal | 3e98cf1ceb | |
Chris Guo | 43679ebd1e | |
Satwik Kansal | 0d65c00bb6 | |
Satwik Kansal | 255b9a574b | |
Nick Muoh | 68f6e0217c | |
Louis Guitton | 3d64252310 | |
Satwik | 185d60c1b6 | |
Satwik Kansal | 1b3b2e6c71 | |
Satwik Kansal | f98bd4363f | |
Satwik | 2c910351b7 | |
Satwik | 9a2718ae3a | |
Satwik Kansal | 183e0d9ee5 | |
Rahul Gopinath | 2f2fcf87bc | |
Satwik Kansal | 99280f57a0 | |
Satwik | 7c85a73442 | |
BoppreH | e4f340281c | |
Satwik | 6c0ed6e7c5 | |
Satwik | dcc2e6a3d8 | |
Satwik | a1b4f8d521 | |
Satwik Kansal | 328168c86f | |
puɐloɹ ʇɹǝqƃǝᴉs | 73a1248d04 | |
Satwik | a39792bd4b | |
Satwik | bd45175405 | |
Satwik | 438f52c3e9 | |
Satwik | b3387c9dc7 | |
Satwik Kansal | ad39ef8625 | |
Satwik Kansal | df8baf9941 | |
Saverio Miroddi | e35642ed05 | |
Ramiro Gómez | f8aa17c8ba | |
Satwik Kansal | b8e4cd1693 | |
Satwik | 76d98d9138 | |
Satwik | d59db75b4c | |
Satwik | 734360ff59 | |
Satwik | 2fb14be424 | |
Satwik | 483496d97a | |
Satwik | f914194a87 | |
Satwik | 12b2fc008e | |
Satwik | 1b1a5bc10d | |
Satwik | 49ed35e099 | |
Satwik | 56c0347dd1 | |
Satwik | 7006084c12 | |
Satwik | a9cbcdd95a | |
Satwik | 9fb381c4f3 | |
Satwik | 264b93a633 | |
Satwik | a7471ca737 | |
Satwik | 6e5278e30a | |
Satwik | 8e798af4fc | |
Satwik | 176bcc8a25 | |
Satwik | 44e885a09c | |
Satwik | dd3c62d49d | |
Satwik | 68904d3f6f | |
Satwik | f30181a54e | |
Satwik | 0c461ee66a | |
Satwik | b96e2fb6a9 | |
Satwik Kansal | 2f383f8dc0 | |
Satwik | ef68d1b482 | |
Satwik | 8522964105 | |
Satwik | f3c7afebd7 | |
Satwik | d7c8b73731 | |
Nikita Sobolev | e899e38553 | |
Satwik | d9e71224e2 | |
Satwik | 65c8a9ef8c | |
Satwik | 888c9e1261 | |
Satwik | e18e56eba3 | |
Satwik | 2cd7e3fccd | |
Satwik | 2161c48e8e | |
Satwik | 321e7196d0 | |
Satwik | 08302ba0c8 | |
Satwik | 2160dad717 | |
Satwik | a553ea0070 | |
Satwik | d4021862f0 | |
Satwik | 1d467287ef | |
Satwik | 0160d5019b | |
Satwik | a5593c42e0 | |
Satwik | 7df49cd818 | |
Satwik | af6d1799d9 | |
Satwik | 5bf46f66af | |
Satwik | 312c5d542c | |
Satwik | 4af4f9debf | |
Satwik | b10b3ad346 | |
Satwik | 133baac11c | |
Satwik | 34e97d53fb | |
Satwik | bd798f2966 | |
Satwik | ce8adb0417 | |
Satwik | 28bcbfd311 | |
Satwik | 82c37ccb32 | |
Satwik | 43355e2498 | |
Satwik | 45a2cb5ddd | |
Satwik | d823aa9220 | |
Satwik Kansal | 8135cbb99c | |
monujee | bef3f2a33d | |
Satwik Kansal | f8acf49d05 | |
Satwik Kansal | 88ccda2bcd | |
mitcom | d143f972b8 | |
Satwik Kansal | fc491c5dd6 | |
Satwik Kansal | 6223715725 | |
Satwik Kansal | 2a1c28ee4d | |
Satwik Kansal | d6b735768c | |
Satwik Kansal | e8fcce27c2 | |
Satwik Kansal | 45638fa6b1 | |
Satwik Kansal | 162458c88e | |
Satwik Kansal | edeb98f406 | |
Satwik Kansal | 9939ff6a1f | |
Satwik Kansal | 6934d94222 | |
Satwik Kansal | 7b22f84f97 | |
Satwik Kansal | 055bd0246d | |
Satwik Kansal | 330f7da1d3 | |
Satwik Kansal | ae05101d70 | |
Satwik Kansal | 2295fb24b7 | |
Satwik Kansal | f365271df3 | |
Satwik Kansal | 9b3b367b45 | |
Satwik Kansal | 5373d0f184 | |
Satwik Kansal | 89c56c2366 | |
Satwik Kansal | e3118ed4da | |
Satwik Kansal | f3b96e4d7f | |
Satwik Kansal | a0832c4459 | |
Satwik Kansal | dbbabbe564 | |
Satwik Kansal | f8a7d38b70 | |
Satwik Kansal | 810dbe1582 | |
Satwik Kansal | a5e7cd7cf8 | |
Satwik Kansal | efdac8f9ca | |
Satwik Kansal | 3479b2befb | |
Satwik Kansal | 290921fe12 | |
Satwik | 03719dea45 | |
Satwik | c5665da81d | |
Satwik Kansal | 0fa3067e5f | |
Kislov Dmitry | cedbfba829 | |
Satwik Kansal | 9f5dbbe4e9 | |
Nikita Sobolev | b0622a10ad | |
Satwik Kansal | ffe6438576 | |
Satwik Kansal | 772a96c36f | |
Satwik Kansal | d3157d61a3 | |
Satwik Kansal | 4618bed5f6 | |
Satwik Kansal | 863e1f4512 | |
Satwik Kansal | 98701351c6 | |
Satwik Kansal | c30e0d2ed6 | |
Satwik Kansal | 4d8e5795a3 | |
Satwik Kansal | 96455422ef | |
Satwik Kansal | e6eac17ef5 | |
Satwik Kansal | 151d0ec93a | |
Zach Kirsch | 12a1ac10cb | |
zachkirsch | e611f24e7f | |
cclauss | a4776a6b67 | |
Satwik Kansal | a83349d0cc | |
cclauss | 14e03a3766 | |
Satwik Kansal | 8b4bbb2196 | |
Satwik Kansal | c6e0d795ff | |
Satwik Kansal | 362447a5d2 | |
Satwik Kansal | 4d5a2f0d97 | |
Satwik Kansal | bf967b0332 | |
Satwik Kansal | 80a969a556 | |
Satwik Kansal | 2bfa6d2e5b | |
Satwik Kansal | 9ea7ab0c5a | |
Satwik Kansal | 72e39d3248 | |
Satwik Kansal | 6164ce065d | |
Satwik Kansal | 85352fc45d | |
Satwik Kansal | a33f715b26 | |
Satwik Kansal | c52919b9ec | |
Satwik Kansal | 092dd096bf | |
Satwik Kansal | e0cb30bf3b | |
Satwik Kansal | bc68ae0ff3 | |
Satwik Kansal | 3806284f78 | |
Satwik Kansal | f03f7dcad9 | |
hippie | 31dcd9b062 | |
Satwik Kansal | 45bec627d1 | |
Satwik Kansal | 5c8c4c5843 | |
Satwik Kansal | c475cbfe82 | |
Satwik Kansal | 596186d81c | |
Satwik Kansal | 54883f5134 | |
Satwik Kansal | b262f29756 | |
kyblockstacking | 30e05a5973 | |
1f604 | 64b310953a | |
Hannes | 9c5f26e758 | |
Hannes | b0e7a816ec | |
Satwik Kansal | d7477885b8 | |
Chris J | 145a194c8b | |
Vibhu Agarwal | ac379c9c03 | |
cclauss | 2fb04501f7 | |
Satwik Kansal | 07861a045d | |
Satwik Kansal | 5484680721 | |
Satwik Kansal | d2507c2ff3 | |
BOOK | 2188fa30cd | |
Satwik Kansal | 3df9152ec9 | |
Satwik Kansal | 518881c70e | |
Harmon | 169fa2fb5e | |
Mélanie Chauvel | db35390786 | |
Satwik Kansal | ea5fc2f47f | |
Satwik Kansal | c13ce9701a | |
Satwik Kansal | 0c9acdcc8e | |
Satwik Kansal | 9608b2fcfc | |
Sohaib Farooqi | 70fe61737b | |
Satwik Kansal | 240e216c51 | |
Satwik Kansal | a0100a8b48 | |
Semen Zhydenko | 17e49ee9db | |
觉 | 7664476e51 | |
Tom Ritchford | a9e72e03f4 | |
Tom Swirly | 54ed75f77d | |
Connor Devlin | 12e517b0e3 | |
Satwik Kansal | 2fda1ef070 | |
Satwik Kansal | fc262f2444 | |
Srdjan Grubor | 5d2e377487 | |
Satwik Kansal | c28b292184 | |
Satwik Kansal | 98ef2dad4a | |
Satwik Kansal | 86462ed1e5 | |
Satwik Kansal | 9d713f0fa5 | |
Satwik Kansal | 79d396a1fb | |
Satwik Kansal | f7db9aace7 | |
Satwik Kansal | 054e88f7b2 | |
Satwik Kansal | 674fc891b4 | |
Satwik Kansal | 9ac6470efc | |
Satwik Kansal | 5061af0b6e | |
Satwik Kansal | 980798fd36 | |
Satwik Kansal | b362cc9d0a |
|
@ -1,5 +1,18 @@
|
|||
.DS_Store
|
||||
|
||||
node_modules
|
||||
npm-debug.log
|
||||
wtfpython-pypi/build/
|
||||
wtfpython-pypi/dist/
|
||||
wtfpython-pypi/wtfpython.egg-info
|
||||
|
||||
# Python-specific byte-compiled files should be ignored
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
irrelevant/.ipynb_checkpoints/
|
||||
|
||||
irrelevant/.python-version
|
||||
|
||||
.idea/
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
irrelevant/
|
|
@ -0,0 +1,3 @@
|
|||
language: python
|
||||
install: pip install flake8
|
||||
script: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
@ -1,10 +1,8 @@
|
|||
All kinds of patches are welcome. Feel free to even suggest some catchy and funny titles for the existing Examples. The goal is to make this collection as interesting to read as possible.
|
||||
All kinds of patches are welcome. Feel free to even suggest some catchy and funny titles for the existing Examples. The goal is to make this collection as interesting to read as possible. Here are a few ways through which you can contribute,
|
||||
|
||||
If the changes you suggest are siginificant, filing an issue before submitting the actual patch will be appreciated. If you'd like to work on the issue (highly encouraged), you can mention that you're interested in working on it while creating the issue and get assigned to it.
|
||||
|
||||
If you're adding a new example, please do create an issue to discuss it before submitting a patch.
|
||||
|
||||
You can use the following template for adding a new example:
|
||||
- If you are interested in translating the project to another language (some people have done that in the past), please feel free to open up an issue, and let me know if you need any kind of help.
|
||||
- If the changes you suggest are significant, filing an issue before submitting the actual patch will be appreciated. If you'd like to work on the issue (highly encouraged), you can mention that you're interested in working on it while creating the issue and get assigned to it.
|
||||
- If you're adding a new example, it is highly recommended to create an issue to discuss it before submitting a patch. You can use the following template for adding a new example:
|
||||
|
||||
<pre>
|
||||
### ▶ Some fancy Title *
|
||||
|
@ -27,10 +25,39 @@ Probably unexpected output
|
|||
```py
|
||||
Setting up examples for clarification (if necessary)
|
||||
```
|
||||
**Outupt:**
|
||||
**Output:**
|
||||
```py
|
||||
>>> trigger # some example that makes it easy to unveil the magic
|
||||
# some justified output
|
||||
```
|
||||
```
|
||||
</pre>
|
||||
|
||||
|
||||
Few things that you can consider while writing an example,
|
||||
|
||||
- If you are choosing to submit a new example without creating an issue and discussing, please check the project to make sure there aren't similar examples already.
|
||||
- Try to be consistent with the namings and the values you use with the variables. For instance, most variable names in the project are along the lines of `some_string`, `some_list`, `some_dict`, etc. You'd see a lot of `x`s for single letter variable names, and `"wtf"` as values for strings. There's no strictly enforced scheme in the project as such, but you can take a glance at other examples to get a gist.
|
||||
- Try to be as creative as possible to add that element of "surprise" in the setting up part of an example. Sometimes this may mean writing a snippet a sane programmer would never write.
|
||||
- Also, feel free to add your name to the [contributors list](/CONTRIBUTORS.md).
|
||||
|
||||
**Some FAQs**
|
||||
|
||||
What is is this after every snippet title (###) in the README: <!-- Example ID: 30f1d3fc-e267-4b30-84ef-4d9e7091ac1a --->? Should it be added manually or can it be ignored when creating new snippets?
|
||||
|
||||
That's a random UUID, it is used to keep identify the examples across multiple translations of the project. As a contributor, you don't have to worry about behind the scenes of how it is used, you just have to add a new random UUID to new examples in that format.
|
||||
|
||||
Where should new snippets be added? Top/bottom of the section, doesn't ?
|
||||
|
||||
There are multiple things that are considered to decide the order (the dependency on the other examples, difficulty level, category, etc). I'd suggest simply adding the new example at the bottom of a section you find more fitting (or just add it to the Miscellaneous section). Its order will be taken care of in future revisions.
|
||||
|
||||
What's the difference between the sections (the first two feel very similar)?
|
||||
|
||||
The section "Strain your brain" contains more contrived examples that you may not really encounter in real life, whereas the section "Slippery Slopes" contains examples that have the potential to be encountered more frequently while programming.
|
||||
|
||||
Before the table of contents it says that markdown-toc -i README.md --maxdepth 3 was used to create it. The pip package markdown-toc does not contain either -i or --maxdepth flags. Which package is meant, or what version of that package?
|
||||
Should the new table of contents entry for the snippet be created with the above command or created manually (in case the above command does more than only add the entry)?
|
||||
|
||||
We use the [markdown-toc](https://www.npmjs.com/package/markdown-toc) npm package to generate ToC. It has some issues with special characters though (I'm not sure if it's fixed yet). More often than not, I just end up inserting the toc link manually at the right place. The tool is handy when I have to big reordering, otherwise just updating toc manually is more convenient imo.
|
||||
|
||||
If you have any questions feel free to ask on [this issue](https://github.com/satwikkansal/wtfpython/issues/269) (thanks to [@LiquidFun](https://github.com/LiquidFun) for starting it).
|
||||
|
|
|
@ -1,13 +1,42 @@
|
|||
I'm really greatful to all the contributors. Following are the wonderful people (in no specific order) who have contributed their examples to wtfpython.
|
||||
Following are the wonderful people (in no specific order) who have contributed their examples to wtfpython.
|
||||
|
||||
| Contributor | Github | Issues |
|
||||
|-------------|--------|--------|
|
||||
| Lucas-C | [Lucas-C](https://github.com/Lucas-C) | [#36](https:/github.com/satwikkansal/wtfpython/issues/36) |
|
||||
| MittalAshok | [MittalAshok](https://github.com/MittalAshok) | [#23](https:/github.com/satwikkansal/wtfpython/issues/23) |
|
||||
| asottile | [asottile](https://github.com/asottile) | [#40](https:/github.com/satwikkansal/wtfpython/issues/40) |
|
||||
| MostAwesomeDude | [MostAwesomeDude](https://github.com/MostAwesomeDude) | [#1](https:/github.com/satwikkansal/wtfpython/issues/1) |
|
||||
| tukkek | [tukkek](https://github.com/tukkek) | [#11](https:/github.com/satwikkansal/wtfpython/issues/11), [#26](https:/github.com/satwikkansal/wtfpython/issues/26) |
|
||||
| PiaFraus | [PiaFraus](https://github.com/PiaFraus) | [#9](https:/github.com/satwikkansal/wtfpython/issues/9) |
|
||||
| chris-rands | [chris-rands](https://github.com/chris-rands) | [#32](https:/github.com/satwikkansal/wtfpython/issues/32) |
|
||||
| Lucas-C | [Lucas-C](https://github.com/Lucas-C) | [#36](https://github.com/satwikkansal/wtfpython/issues/36) |
|
||||
| MittalAshok | [MittalAshok](https://github.com/MittalAshok) | [#23](https://github.com/satwikkansal/wtfpython/issues/23) |
|
||||
| asottile | [asottile](https://github.com/asottile) | [#40](https://github.com/satwikkansal/wtfpython/issues/40) |
|
||||
| MostAwesomeDude | [MostAwesomeDude](https://github.com/MostAwesomeDude) | [#1](https://github.com/satwikkansal/wtfpython/issues/1) |
|
||||
| tukkek | [tukkek](https://github.com/tukkek) | [#11](https://github.com/satwikkansal/wtfpython/issues/11), [#26](https://github.com/satwikkansal/wtfpython/issues/26) |
|
||||
| PiaFraus | [PiaFraus](https://github.com/PiaFraus) | [#9](https://github.com/satwikkansal/wtfpython/issues/9) |
|
||||
| chris-rands | [chris-rands](https://github.com/chris-rands) | [#32](https://github.com/satwikkansal/wtfpython/issues/32) |
|
||||
| sohaibfarooqi | [sohaibfarooqi](https://github.com/sohaibfarooqi) | [#63](https://github.com/satwikkansal/wtfpython/issues/63) |
|
||||
| ipid | [ipid](https://github.com/ipid) | [#145](https://github.com/satwikkansal/wtfpython/issues/145) |
|
||||
| roshnet | [roshnet](https://github.com/roshnet) | [#140](https://github.com/satwikkansal/wtfpython/issues/140) |
|
||||
| daidai21 | [daidai21](https://github.com/daidai21) | [#137](https://github.com/satwikkansal/wtfpython/issues/137) |
|
||||
| scidam | [scidam](https://github.com/scidam) | [#136](https://github.com/satwikkansal/wtfpython/issues/136) |
|
||||
| pmjpawelec | [pmjpawelec](https://github.com/pmjpawelec) | [#121](https://github.com/satwikkansal/wtfpython/issues/121) |
|
||||
| leisurelicht | [leisurelicht](https://github.com/leisurelicht) | [#112](https://github.com/satwikkansal/wtfpython/issues/112) |
|
||||
| mishaturnbull | [mishaturnbull](https://github.com/mishaturnbull) | [#108](https://github.com/satwikkansal/wtfpython/issues/108) |
|
||||
| MuseBoy | [MuseBoy](https://github.com/MuseBoy) | [#101](https://github.com/satwikkansal/wtfpython/issues/101) |
|
||||
| Ghost account | N/A | [#96](https://github.com/satwikkansal/wtfpython/issues/96) |
|
||||
| koddo | [koddo](https://github.com/koddo) | [#80](https://github.com/satwikkansal/wtfpython/issues/80), [#73](https://github.com/satwikkansal/wtfpython/issues/73) |
|
||||
| jab | [jab](https://github.com/jab) | [#77](https://github.com/satwikkansal/wtfpython/issues/77) |
|
||||
| Jongy | [Jongy](https://github.com/Jongy) | [#208](https://github.com/satwikkansal/wtfpython/issues/208), [#210](https://github.com/satwikkansal/wtfpython/issues/210), [#233](https://github.com/satwikkansal/wtfpython/issues/233) |
|
||||
| Diptangsu Goswami | [diptangsu](https://github.com/diptangsu) | [#193](https://github.com/satwikkansal/wtfpython/issues/193) |
|
||||
| Charles | [charles-l](https://github.com/charles-l) | [#245](https://github.com/satwikkansal/wtfpython/issues/245) |
|
||||
| LiquidFun | [LiquidFun](https://github.com/LiquidFun) | [#267](https://github.com/satwikkansal/wtfpython/issues/267) |
|
||||
|
||||
Thank you all for taking out time, and helping to make this project awesome! :smile:
|
||||
---
|
||||
|
||||
**Translations**
|
||||
|
||||
| Translator | Github | Language |
|
||||
|-------------|--------|--------|
|
||||
| leisurelicht | [leisurelicht](https://github.com/leisurelicht) | [Chinese](https://github.com/leisurelicht/wtfpython-cn) |
|
||||
| vuduclyunitn | [vuduclyunitn](https://github.com/vuduclyunitn) | [Vietnamese](https://github.com/vuduclyunitn/wtfptyhon-vi) |
|
||||
| José De Freitas | [JoseDeFreitas](https://github.com/JoseDeFreitas) | [Spanish](https://github.com/JoseDeFreitas/wtfpython-es) |
|
||||
| Vadim Nifadev | [nifadyev](https://github.com/nifadyev) | [Russian](https://github.com/satwikkansal/wtfpython/tree/master/translations/ru-russian) |
|
||||
|
||||
Thank you all for your time and making wtfpython more awesome! :smile:
|
||||
|
||||
PS: This list is updated after every major release, if I forgot to add your contribution here, please feel free to raise a Pull request.
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||
education, socio-economic status, nationality, personal appearance, race,
|
||||
religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 113 KiB |
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
After Width: | Height: | Size: 8.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 9.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 7.3 KiB |
|
@ -0,0 +1,24 @@
|
|||
import uuid
|
||||
|
||||
new_file = []
|
||||
original_file = []
|
||||
|
||||
fname = "../README.md"
|
||||
|
||||
|
||||
def generate_random_id_comment():
|
||||
random_id = uuid.uuid4()
|
||||
return f"<!-- Example ID: {random_id} --!>"
|
||||
|
||||
|
||||
with open(fname, "r") as f:
|
||||
original_file = f.readlines()
|
||||
|
||||
|
||||
for line in original_file:
|
||||
new_file.append(line)
|
||||
if line.strip().startswith("### "):
|
||||
new_file.append(generate_random_id_comment())
|
||||
|
||||
with open(fname, "w") as f:
|
||||
f.write("".join(new_file))
|
|
@ -0,0 +1,397 @@
|
|||
"""
|
||||
An inefficient monolithic piece of code that'll generate jupyter notebook
|
||||
from the projects main README.
|
||||
|
||||
PS: If you are a recruiter, please don't judge me by this piece of code. I wrote it
|
||||
in hurry. I know this is messy and can be simplified, but I don't want to change it
|
||||
much because it just works.
|
||||
|
||||
Simplifictions and improvements through patches are more than welcome however :)
|
||||
|
||||
|
||||
#TODOs
|
||||
|
||||
- CLI arguments for running this thing
|
||||
- Add it to prepush hook
|
||||
- Add support for skip comments, to skip examples that are not meant for notebook environment.
|
||||
- Use templates?
|
||||
"""
|
||||
|
||||
import json
|
||||
import os
|
||||
import pprint
|
||||
|
||||
fpath = os.path.join(os.path.dirname( __file__ ), '..', 'README.md')
|
||||
examples = []
|
||||
|
||||
# The globals
|
||||
current_example = 1
|
||||
sequence_num = 1
|
||||
current_section_name = ""
|
||||
|
||||
|
||||
STATEMENT_PREFIXES = ["...", ">>> ", "$ "]
|
||||
|
||||
HOSTED_NOTEBOOK_INSTRUCTIONS = """
|
||||
|
||||
## Hosted notebook instructions
|
||||
|
||||
This is just an experimental attempt of browsing wtfpython through jupyter notebooks. Some examples are read-only because,
|
||||
- they either require a version of Python that's not supported in the hosted runtime.
|
||||
- or they can't be reproduced in the notebook envrinonment.
|
||||
|
||||
The expected outputs are already present in collapsed cells following the code cells. The Google colab provides Python2 (2.7) and Python3 (3.6, default) runtimes. You can switch among these for Python2 specific examples. For examples specific to other minor versions, you can simply refer to collapsed outputs (it's not possible to control the minor version in hosted notebooks as of now). You can check the active version using
|
||||
|
||||
```py
|
||||
>>> import sys
|
||||
>>> sys.version
|
||||
# Prints out Python version here.
|
||||
```
|
||||
|
||||
That being said, most of the examples do work as expected. If you face any trouble, feel free to consult the original content on wtfpython and create an issue in the repo. Have fun!
|
||||
|
||||
---
|
||||
"""
|
||||
|
||||
|
||||
def generate_code_block(statements, output):
|
||||
"""
|
||||
Generates a code block that executes the given statements.
|
||||
|
||||
:param statements: The list of statements to execute.
|
||||
:type statements: list(str)
|
||||
"""
|
||||
global sequence_num
|
||||
result = {
|
||||
"type": "code",
|
||||
"sequence_num": sequence_num,
|
||||
"statements": statements,
|
||||
"output": output
|
||||
}
|
||||
sequence_num += 1
|
||||
return result
|
||||
|
||||
|
||||
def generate_markdown_block(lines):
|
||||
"""
|
||||
Generates a markdown block from a list of lines.
|
||||
"""
|
||||
global sequence_num
|
||||
result = {
|
||||
"type": "markdown",
|
||||
"sequence_num": sequence_num,
|
||||
"value": lines
|
||||
}
|
||||
sequence_num += 1
|
||||
return result
|
||||
|
||||
|
||||
def is_interactive_statement(line):
|
||||
for prefix in STATEMENT_PREFIXES:
|
||||
if line.lstrip().startswith(prefix):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def parse_example_parts(lines, title, current_line):
|
||||
"""
|
||||
Parse the given lines and return a dictionary with two keys:
|
||||
build_up, which contains all the text before an H4 (explanation) is encountered,
|
||||
and
|
||||
explanation, which contains all the text after build_up until --- or another H3 is encountered.
|
||||
"""
|
||||
parts = {
|
||||
"build_up": [],
|
||||
"explanation": []
|
||||
}
|
||||
content = [title]
|
||||
statements_so_far = []
|
||||
output_so_far = []
|
||||
next_line = current_line
|
||||
# store build_up till an H4 (explanation) is encountered
|
||||
while not (next_line.startswith("#### ")or next_line.startswith('---')):
|
||||
# Watching out for the snippets
|
||||
if next_line.startswith("```py"):
|
||||
# It's a snippet, whatever found until now is text
|
||||
is_interactive = False
|
||||
output_encountered = False
|
||||
if content:
|
||||
parts["build_up"].append(generate_markdown_block(content))
|
||||
content = []
|
||||
|
||||
next_line = next(lines)
|
||||
|
||||
while not next_line.startswith("```"):
|
||||
if is_interactive_statement(next_line):
|
||||
is_interactive = True
|
||||
if (output_so_far):
|
||||
parts["build_up"].append(generate_code_block(statements_so_far, output_so_far))
|
||||
statements_so_far, output_so_far = [], []
|
||||
statements_so_far.append(next_line)
|
||||
else:
|
||||
# can be either output or normal code
|
||||
if is_interactive:
|
||||
output_so_far.append(next_line)
|
||||
elif output_encountered:
|
||||
output_so_far.append(next_line)
|
||||
else:
|
||||
statements_so_far.append(next_line)
|
||||
next_line = next(lines)
|
||||
|
||||
# Snippet is over
|
||||
parts["build_up"].append(generate_code_block(statements_so_far, output_so_far))
|
||||
statements_so_far, output_so_far = [], []
|
||||
next_line = next(lines)
|
||||
else:
|
||||
# It's a text, go on.
|
||||
content.append(next_line)
|
||||
next_line = next(lines)
|
||||
|
||||
# Explanation encountered, save any content till now (if any)
|
||||
if content:
|
||||
parts["build_up"].append(generate_markdown_block(content))
|
||||
|
||||
# Reset stuff
|
||||
content = []
|
||||
statements_so_far, output_so_far = [], []
|
||||
|
||||
# store lines again until --- or another H3 is encountered
|
||||
while not (next_line.startswith("---") or
|
||||
next_line.startswith("### ")):
|
||||
if next_line.lstrip().startswith("```py"):
|
||||
# It's a snippet, whatever found until now is text
|
||||
is_interactive = False
|
||||
if content:
|
||||
parts["explanation"].append(generate_markdown_block(content))
|
||||
content = []
|
||||
|
||||
next_line = next(lines)
|
||||
|
||||
while not next_line.lstrip().startswith("```"):
|
||||
if is_interactive_statement(next_line):
|
||||
is_interactive = True
|
||||
if (output_so_far):
|
||||
parts["explanation"].append(generate_code_block(statements_so_far, output_so_far))
|
||||
statements_so_far, output_so_far = [], []
|
||||
statements_so_far.append(next_line)
|
||||
else:
|
||||
# can be either output or normal code
|
||||
if is_interactive:
|
||||
output_so_far.append(next_line)
|
||||
else:
|
||||
statements_so_far.append(next_line)
|
||||
next_line = next(lines)
|
||||
|
||||
# Snippet is over
|
||||
parts["explanation"].append(generate_code_block(statements_so_far, output_so_far))
|
||||
statements_so_far, output_so_far = [], []
|
||||
next_line = next(lines)
|
||||
else:
|
||||
# It's a text, go on.
|
||||
content.append(next_line)
|
||||
next_line = next(lines)
|
||||
|
||||
# All done
|
||||
if content:
|
||||
parts["explanation"].append(generate_markdown_block(content))
|
||||
|
||||
return next_line, parts
|
||||
|
||||
|
||||
def remove_from_beginning(tokens, line):
|
||||
for token in tokens:
|
||||
if line.lstrip().startswith(token):
|
||||
line = line.replace(token, "")
|
||||
return line
|
||||
|
||||
|
||||
def inspect_and_sanitize_code_lines(lines):
|
||||
"""
|
||||
Remove lines from the beginning of a code block that are not statements.
|
||||
|
||||
:param lines: A list of strings, each representing a line in the code block.
|
||||
:returns is_print_present, sanitized_lines: A boolean indicating whether print was present in the original code and a list of strings representing
|
||||
sanitized lines. The latter may be an empty list if all input lines were removed as comments or whitespace (and thus did not contain any statements).
|
||||
This function does not remove blank lines at the end of `lines`.
|
||||
"""
|
||||
tokens_to_remove = STATEMENT_PREFIXES
|
||||
result = []
|
||||
is_print_present = False
|
||||
for line in lines:
|
||||
line = remove_from_beginning(tokens_to_remove, line)
|
||||
if line.startswith("print ") or line.startswith("print("):
|
||||
is_print_present = True
|
||||
result.append(line)
|
||||
return is_print_present, result
|
||||
|
||||
|
||||
def convert_to_cells(cell_contents, read_only):
|
||||
"""
|
||||
Converts a list of dictionaries containing markdown and code cells into a Jupyter notebook.
|
||||
|
||||
:param cell_contents: A list of dictionaries, each
|
||||
dictionary representing either a markdown or code cell. Each dictionary should have the following keys: "type", which is either "markdown" or "code",
|
||||
and "value". The value for type = 'markdown' is the content as string, whereas the value for type = 'code' is another dictionary with two keys,
|
||||
statements and output. The statements key contains all lines in between ```py\n``` (including) until ```\n```, while output contains all lines after
|
||||
```.output py\n```.
|
||||
:type cell_contents: List[Dict]
|
||||
|
||||
:param read_only (optional): If True then only print outputs are included in converted
|
||||
cells. Default False
|
||||
:type read_only (optional): bool
|
||||
|
||||
:returns A Jupyter notebook containing all cells from input parameter `cell_contents`.
|
||||
Each converted cell has metadata attribute collapsed set to true if it's code-cell otherwise None if it's markdow-cell.
|
||||
"""
|
||||
cells = []
|
||||
for stuff in cell_contents:
|
||||
if stuff["type"] == "markdown":
|
||||
# todo add metadata later
|
||||
cells.append(
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": stuff["value"]
|
||||
}
|
||||
)
|
||||
elif stuff["type"] == "code":
|
||||
if read_only:
|
||||
# Skip read only
|
||||
# TODO: Fix
|
||||
cells.append(
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": ["```py\n"] + stuff["statements"] + ["```\n"] + ["```py\n"] + stuff['output'] + ["```\n"]
|
||||
}
|
||||
)
|
||||
continue
|
||||
|
||||
is_print_present, sanitized_code = inspect_and_sanitize_code_lines(stuff["statements"])
|
||||
if is_print_present:
|
||||
cells.append(
|
||||
{
|
||||
"cell_type": "code",
|
||||
"metadata": {
|
||||
"collapsed": True,
|
||||
|
||||
},
|
||||
"execution_count": None,
|
||||
"outputs": [{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": stuff["output"]
|
||||
}],
|
||||
"source": sanitized_code
|
||||
}
|
||||
)
|
||||
else:
|
||||
cells.append(
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": None,
|
||||
"metadata": {
|
||||
"collapsed": True
|
||||
},
|
||||
"outputs": [{
|
||||
"data": {
|
||||
"text/plain": stuff["output"]
|
||||
},
|
||||
"output_type": "execute_result",
|
||||
"metadata": {},
|
||||
"execution_count": None
|
||||
}],
|
||||
"source": sanitized_code
|
||||
}
|
||||
)
|
||||
|
||||
return cells
|
||||
|
||||
|
||||
def convert_to_notebook(pre_examples_content, parsed_json, post_examples_content):
|
||||
"""
|
||||
Convert a JSON file containing the examples to a Jupyter Notebook.
|
||||
"""
|
||||
result = {
|
||||
"cells": [],
|
||||
"metadata": {},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
||||
|
||||
notebook_path = "wtf.ipynb"
|
||||
|
||||
result["cells"] += convert_to_cells([generate_markdown_block(pre_examples_content)], False)
|
||||
|
||||
for example in parsed_json:
|
||||
parts = example["parts"]
|
||||
build_up = parts.get("build_up")
|
||||
explanation = parts.get("explanation")
|
||||
read_only = example.get("read_only")
|
||||
|
||||
if build_up:
|
||||
result["cells"] += convert_to_cells(build_up, read_only)
|
||||
|
||||
if explanation:
|
||||
result["cells"] += convert_to_cells(explanation, read_only)
|
||||
|
||||
result["cells"] += convert_to_cells([generate_markdown_block(post_examples_content)], False)
|
||||
|
||||
#pprint.pprint(result, indent=2)
|
||||
with open(notebook_path, "w") as f:
|
||||
json.dump(result, f, indent=2)
|
||||
|
||||
|
||||
with open(fpath, 'r+', encoding="utf-8") as f:
|
||||
lines = iter(f.readlines())
|
||||
line = next(lines)
|
||||
result = []
|
||||
pre_examples_phase = True
|
||||
pre_stuff = []
|
||||
post_stuff = []
|
||||
try:
|
||||
while True:
|
||||
if line.startswith("## "):
|
||||
pre_examples_phase = False
|
||||
# A section is encountered
|
||||
current_section_name = line.replace("## ", "").strip()
|
||||
section_text = []
|
||||
line = next(lines)
|
||||
# Until a new section is encountered
|
||||
while not (line.startswith("## ") or line.startswith("# ")):
|
||||
# check if it's a H3
|
||||
if line.startswith("### "):
|
||||
# An example is encountered
|
||||
title_line = line
|
||||
line = next(lines)
|
||||
read_only = False
|
||||
while line.strip() == "" or line.startswith('<!--'):
|
||||
#TODO: Capture example ID here using regex.
|
||||
if '<!-- read-only -->' in line:
|
||||
read_only = True
|
||||
line = next(lines)
|
||||
|
||||
example_details = {
|
||||
"id": current_example,
|
||||
"title": title_line.replace("### ", ""),
|
||||
"section": current_section_name,
|
||||
"read_only": read_only
|
||||
}
|
||||
line, example_details["parts"] = parse_example_parts(lines, title_line, line)
|
||||
result.append(example_details)
|
||||
current_example += 1
|
||||
else:
|
||||
section_text.append(line)
|
||||
line = next(lines)
|
||||
else:
|
||||
if pre_examples_phase:
|
||||
pre_stuff.append(line)
|
||||
else:
|
||||
post_stuff.append(line)
|
||||
line = next(lines)
|
||||
|
||||
except StopIteration as e:
|
||||
#pprint.pprint(result, indent=2)
|
||||
pre_stuff.append(HOSTED_NOTEBOOK_INSTRUCTIONS)
|
||||
result.sort(key = lambda x: x["read_only"])
|
||||
convert_to_notebook(pre_stuff, result, post_stuff)
|
|
@ -0,0 +1,7 @@
|
|||
## Generating the notebook
|
||||
|
||||
- Expand the relative links in README.md to absolute ones
|
||||
- Remove the TOC in README.md (because Google colab generates its own anyway)
|
||||
- Reorder the examples, so that the ones that work are upfront.
|
||||
- Run the `notebook_generator.py`, it will generate a notebook named `wtf.ipynb`
|
||||
- Revert the README.md changes (optional)
|
|
@ -139,7 +139,7 @@ f*
|
|||
Half triple-quoted strings
|
||||
f
|
||||
|
||||
Implicity key type conversion
|
||||
Implicit key type conversion
|
||||
f*
|
||||
|
||||
Stubborn `del` operator
|
|
@ -1,6 +1,8 @@
|
|||
"""
|
||||
Parses the README.md and generated the table
|
||||
This script parses the README.md and generates the table
|
||||
`CONTRIBUTORS.md`.
|
||||
|
||||
No longer works since we've moved on contributors to CONTRIBUTORS.md entirely.
|
||||
"""
|
||||
|
||||
import pprint
|
||||
|
@ -39,7 +41,7 @@ for handle, issues in contribs.items():
|
|||
issue_string = ', '.join([issue_format.format(i, i) for i in issues])
|
||||
resp = requests.get(github_rest_api.format(handle))
|
||||
name = handle
|
||||
if resp.status_code is 200:
|
||||
if resp.status_code == 200:
|
||||
pprint.pprint(resp.json()['name'])
|
||||
else:
|
||||
print(handle, resp.content)
|
||||
|
@ -48,4 +50,4 @@ for handle, issues in contribs.items():
|
|||
handle,
|
||||
issue_string))
|
||||
|
||||
print(table_header + "\n".join(rows_so_far))
|
||||
print(table_header + "\n".join(rows_so_far))
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
"""
|
||||
This inefficient module would parse the README.md in the initial version of
|
||||
WTFPython, and enabl me to categorize and reorder a hell lot of examples with
|
||||
WTFPython, and enable me to categorize and reorder a hell lot of examples with
|
||||
the help of the file `add_categories` (part of which is automatically
|
||||
generated).
|
||||
|
||||
|
@ -10,6 +10,12 @@ After the refactor, this module would not work now with necessary updates in
|
|||
the code.
|
||||
"""
|
||||
|
||||
try:
|
||||
raw_input # Python 2
|
||||
except NameError:
|
||||
raw_input = input # Python 3
|
||||
|
||||
|
||||
fname = "README.md"
|
||||
snippets = []
|
||||
|
||||
|
@ -80,6 +86,7 @@ with open("add_categories", "r") as f:
|
|||
}
|
||||
content.next()
|
||||
except StopIteration:
|
||||
pass
|
||||
|
||||
for idx, snip in enumerate(snippets):
|
||||
snippets[idx]["category"] = snips_by_title[snip["title"]]["category"]
|
File diff suppressed because it is too large
Load Diff
|
@ -1,41 +0,0 @@
|
|||
{
|
||||
"name": "wtfpython",
|
||||
"version": "2.0.0",
|
||||
"description": "A collection of trick Python snippets and lesser known features",
|
||||
"bin": "wtfpython",
|
||||
"scripts": {
|
||||
"postpublish": "git push origin master",
|
||||
"toc": "doctoc --github --title '# Table of Contents' --maxlevel 3 README.md"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/satwikkansal/wtfPython.git"
|
||||
},
|
||||
"keywords": [
|
||||
"python",
|
||||
"specification",
|
||||
"notes",
|
||||
"wtf",
|
||||
"learning",
|
||||
"guide",
|
||||
"handbook"
|
||||
],
|
||||
"author": "Satwik Kansal <satwikkansal@gmail.com> (https://satwikkansal.xyz)",
|
||||
"license": "WTFPL 2.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/satwikkansal/wtfPython/issues"
|
||||
},
|
||||
"homepage": "https://github.com/satwikkansal/wtfPython#readme",
|
||||
"devDependencies": {
|
||||
"doctoc": "^1.3.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"boxen": "^1.1.0",
|
||||
"chalk": "^1.1.1",
|
||||
"default-pager": "^1.1.0",
|
||||
"meow": "^3.7.0",
|
||||
"msee": "^0.3.3",
|
||||
"through2": "^2.0.2",
|
||||
"update-notifier": "^2.0.0"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
Приветствуются все виды изменений. Не стесняйтесь предлагать броские и смешные названия для существующих примеров. Цель - сделать эту коллекцию как можно более интересной для чтения. Вот несколько способов, с помощью которых вы можете внести свой вклад,
|
||||
|
||||
- Если вы заинтересованы в переводе проекта на другой язык (некоторые люди уже делали это в прошлом), пожалуйста, не стесняйтесь открыть тему и дайте мне знать, если вам нужна какая-либо помощь.
|
||||
- Если изменения, которые вы предлагаете, значительны, то создание issue перед внесением изменений будет оценено по достоинству. Если вы хотите поработать над issue (это очень рекомендуется), выразите свою заинтересованность и вы будете назначены исполнителем.
|
||||
- Если вы добавляете новый пример, настоятельно рекомендуется создать issue, чтобы обсудить ее перед отправкой изменений. Для добавления нового примера вы можете использовать следующий шаблон:
|
||||
|
||||
<pre>
|
||||
### ▶ Какое-то причудливое название. *
|
||||
* в конце названия означает, что пример был добавлен недавно.
|
||||
|
||||
```py
|
||||
# Подготовка кода.
|
||||
# Подготовка к волшебству...
|
||||
```
|
||||
|
||||
**Вывод (версия Python):**
|
||||
```py
|
||||
>>> triggering_statement
|
||||
Вероятно, неожиданный вывод
|
||||
|
||||
```
|
||||
(Необязательно): Одна строка, описывающая неожиданный вывод.
|
||||
|
||||
#### 💡 Объяснение:
|
||||
* Краткое объяснение того, что происходит и почему это происходит.
|
||||
```py
|
||||
Подготовка примеров для пояснения (при необходимости)
|
||||
```
|
||||
|
||||
**Вывод:**
|
||||
```py
|
||||
>>> trigger # пример, облегчающий понимание магии
|
||||
# обоснованный вывод
|
||||
```
|
||||
</pre>
|
||||
|
||||
Несколько моментов, которые стоит учитывать при написании примера,
|
||||
|
||||
- Если вы решили отправить новый пример без создания issue и обсуждения, пожалуйста, проверьте проект, чтобы убедиться, что в нем уже нет похожих примеров.
|
||||
- Старайтесь быть последовательными в именах и значениях, которые вы используете для переменных. Например, большинство имен переменных в проекте имеют вид `some_string`, `some_list`, `some_dict` и т.д. Вы увидите много `x` для однобуквенных имен переменных, и `"wtf"` в качестве значений для строк. В проекте нет строгой схемы, как таковой, но вы можете взглянуть на другие примеры, чтобы понять суть.
|
||||
- Старайтесь быть как можно более креативными, чтобы добавить элемент "сюрприза" во время подготовки примеров. Иногда это может означать написание фрагмента, который здравомыслящий программист никогда бы не написал.
|
||||
- Также не стесняйтесь добавлять свое имя в список [контрибьюторов](/CONTRIBUTORS.md).
|
||||
|
||||
**Некоторые часто задаваемые вопросы**
|
||||
|
||||
Что это такое после каждого заголовка сниппета (###) в README: <!-- ID примера: 30f1d3fc-e267-4b30-84ef-4d9e7091ac1a --->? Нужно ли его добавлять вручную или можно игнорировать при создании новых сниппетов?
|
||||
|
||||
Это случайный UUID, он используется для идентификации примеров в нескольких переводах проекта. Как контрибьютор, вы не должны беспокоиться о том, как он используется, вы просто должны добавлять новый случайный UUID к новым примерам в этом формате.
|
||||
|
||||
Куда следует добавлять новые сниппеты? В начало/в конец раздела?
|
||||
|
||||
При определении порядка учитывается множество факторов (зависимость от других примеров, уровень сложности, категория и т.д.). Я бы предложил просто добавить новый пример в конец раздела, который вы считаете более подходящим (или просто добавить его в раздел "Разное"). О его порядке можно будет позаботиться в будущих редакциях.
|
||||
|
||||
В чем разница между разделами (первые два очень похожи)?
|
||||
|
||||
Раздел "Напрягите мозг" содержит более надуманные примеры, с которыми вы не столкнетесь в реальной жизни, в то время как раздел "Скользкие склоны" содержит примеры, с которыми можно чаще сталкиваться при программировании.
|
||||
|
||||
Перед оглавлением написано, что для его создания использовался markdown-toc -i README.md --maxdepth 3. Пакет pip markdown-toc не содержит ни флагов -i, ни --maxdepth. Какой пакет имеется в виду, или какая версия этого пакета?
|
||||
Должна ли новая запись в оглавлении для фрагмента быть создана с помощью вышеуказанной команды или вручную (в случае, если вышеуказанная команда делает больше, чем просто добавляет запись)?
|
||||
|
||||
Мы используем пакет [markdown-toc](https://www.npmjs.com/package/markdown-toc) npm для создания ToC (содержание). Однако у него есть некоторые проблемы со специальными символами (не уверен, что они уже исправлены). Чаще всего я просто вставляю ссылку toc вручную в нужное место. Инструмент удобен, когда мне нужно сделать большую перестановку, в остальных случаях просто обновлять toc вручную удобнее.
|
||||
|
||||
Если у вас есть вопросы, не стесняйтесь спрашивать в [issue](https://github.com/satwikkansal/wtfpython/issues/269) (спасибо [@LiquidFun](https://github.com/LiquidFun) за ее создание).
|
|
@ -0,0 +1,42 @@
|
|||
Ниже перечислены (без определенного порядка) замечательные люди, которые внесли вклад в развитие wtfpython.
|
||||
|
||||
| Автор | Github | Issues |
|
||||
|-------------|--------|--------|
|
||||
| Lucas-C | [Lucas-C](https://github.com/Lucas-C) | [#36](https://github.com/satwikkansal/wtfpython/issues/36) |
|
||||
| MittalAshok | [MittalAshok](https://github.com/MittalAshok) | [#23](https://github.com/satwikkansal/wtfpython/issues/23) |
|
||||
| asottile | [asottile](https://github.com/asottile) | [#40](https://github.com/satwikkansal/wtfpython/issues/40) |
|
||||
| MostAwesomeDude | [MostAwesomeDude](https://github.com/MostAwesomeDude) | [#1](https://github.com/satwikkansal/wtfpython/issues/1) |
|
||||
| tukkek | [tukkek](https://github.com/tukkek) | [#11](https://github.com/satwikkansal/wtfpython/issues/11), [#26](https://github.com/satwikkansal/wtfpython/issues/26) |
|
||||
| PiaFraus | [PiaFraus](https://github.com/PiaFraus) | [#9](https://github.com/satwikkansal/wtfpython/issues/9) |
|
||||
| chris-rands | [chris-rands](https://github.com/chris-rands) | [#32](https://github.com/satwikkansal/wtfpython/issues/32) |
|
||||
| sohaibfarooqi | [sohaibfarooqi](https://github.com/sohaibfarooqi) | [#63](https://github.com/satwikkansal/wtfpython/issues/63) |
|
||||
| ipid | [ipid](https://github.com/ipid) | [#145](https://github.com/satwikkansal/wtfpython/issues/145) |
|
||||
| roshnet | [roshnet](https://github.com/roshnet) | [#140](https://github.com/satwikkansal/wtfpython/issues/140) |
|
||||
| daidai21 | [daidai21](https://github.com/daidai21) | [#137](https://github.com/satwikkansal/wtfpython/issues/137) |
|
||||
| scidam | [scidam](https://github.com/scidam) | [#136](https://github.com/satwikkansal/wtfpython/issues/136) |
|
||||
| pmjpawelec | [pmjpawelec](https://github.com/pmjpawelec) | [#121](https://github.com/satwikkansal/wtfpython/issues/121) |
|
||||
| leisurelicht | [leisurelicht](https://github.com/leisurelicht) | [#112](https://github.com/satwikkansal/wtfpython/issues/112) |
|
||||
| mishaturnbull | [mishaturnbull](https://github.com/mishaturnbull) | [#108](https://github.com/satwikkansal/wtfpython/issues/108) |
|
||||
| MuseBoy | [MuseBoy](https://github.com/MuseBoy) | [#101](https://github.com/satwikkansal/wtfpython/issues/101) |
|
||||
| Ghost account | N/A | [#96](https://github.com/satwikkansal/wtfpython/issues/96) |
|
||||
| koddo | [koddo](https://github.com/koddo) | [#80](https://github.com/satwikkansal/wtfpython/issues/80), [#73](https://github.com/satwikkansal/wtfpython/issues/73) |
|
||||
| jab | [jab](https://github.com/jab) | [#77](https://github.com/satwikkansal/wtfpython/issues/77) |
|
||||
| Jongy | [Jongy](https://github.com/Jongy) | [#208](https://github.com/satwikkansal/wtfpython/issues/208), [#210](https://github.com/satwikkansal/wtfpython/issues/210), [#233](https://github.com/satwikkansal/wtfpython/issues/233) |
|
||||
| Diptangsu Goswami | [diptangsu](https://github.com/diptangsu) | [#193](https://github.com/satwikkansal/wtfpython/issues/193) |
|
||||
| Charles | [charles-l](https://github.com/charles-l) | [#245](https://github.com/satwikkansal/wtfpython/issues/245) |
|
||||
| LiquidFun | [LiquidFun](https://github.com/LiquidFun) | [#267](https://github.com/satwikkansal/wtfpython/issues/267) |
|
||||
|
||||
---
|
||||
|
||||
**Переводчики**
|
||||
|
||||
| Переводчик | Github | Язык |
|
||||
|-------------|--------|--------|
|
||||
| leisurelicht | [leisurelicht](https://github.com/leisurelicht) | [Chinese](https://github.com/leisurelicht/wtfpython-cn) |
|
||||
| vuduclyunitn | [vuduclyunitn](https://github.com/vuduclyunitn) | [Vietnamese](https://github.com/vuduclyunitn/wtfptyhon-vi) |
|
||||
| José De Freitas | [JoseDeFreitas](https://github.com/JoseDeFreitas) | [Spanish](https://github.com/JoseDeFreitas/wtfpython-es) |
|
||||
| Vadim Nifadev | [nifadyev](https://github.com/nifadyev) | [Russian](https://github.com/satwikkansal/wtfpython/tree/master/translations/ru-russian) |
|
||||
|
||||
Спасибо всем за ваше время и за то, что делаете wtfpython еще более потрясающим! :smile:
|
||||
|
||||
PS: Этот список обновляется после каждого крупного релиза, если я забыл добавить сюда ваш вклад, пожалуйста, не стесняйтесь сделать Pull request.
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,70 @@
|
|||
# Кодекс Поведения участника
|
||||
|
||||
## Наши обязательства
|
||||
|
||||
Мы, как участники, авторы и лидеры обязуемся сделать участие в сообществе
|
||||
свободным от притеснений для всех, независимо от возраста, телосложения,
|
||||
видимых или невидимых ограничений способности, этнической принадлежности,
|
||||
половых признаков, гендерной идентичности и выражения, уровня опыта,
|
||||
образования, социально-экономического статуса, национальности, внешности,
|
||||
расы, религии, или сексуальной идентичности и ориентации.
|
||||
|
||||
Мы обещаем действовать и взаимодействовать таким образом, чтобы вносить вклад в открытое,
|
||||
дружелюбное, многообразное, инклюзивное и здоровое сообщество.
|
||||
|
||||
## Наши стандарты
|
||||
|
||||
Примеры поведения, создающие условия для благоприятных взаимоотношений включают в себя:
|
||||
|
||||
* Проявление доброты и эмпатии к другим участникам проекта
|
||||
* Уважение к чужой точке зрения и опыту
|
||||
* Конструктивная критика и принятие конструктивной критики
|
||||
* Принятие ответственности, принесение извинений тем, кто пострадал от наших ошибок
|
||||
и извлечение уроков из опыта
|
||||
* Ориентирование на то, что лучше подходит для сообщества, а не только для нас лично
|
||||
|
||||
Примеры неприемлемого поведения участников включают в себя:
|
||||
|
||||
* Использование выражений или изображений сексуального характера и нежелательное сексуальное внимание или домогательство в любой форме
|
||||
* Троллинг, оскорбительные или уничижительные комментарии, переход на личности или затрагивание политических убеждений
|
||||
* Публичное или приватное домогательство
|
||||
* Публикация личной информации других лиц, например, физического или электронного адреса, без явного разрешения
|
||||
* Иное поведение, которое обоснованно считать неуместным в профессиональной обстановке
|
||||
|
||||
## Обязанности
|
||||
|
||||
Лидеры сообщества отвечают за разъяснение и применение наших стандартов приемлемого
|
||||
поведения и будут предпринимать соответствующие и честные меры по исправлению положения
|
||||
в ответ на любое поведение, которое они сочтут неприемлемым, угрожающим, оскорбительным или вредным.
|
||||
|
||||
Лидеры сообщества обладают правом и обязанностью удалять, редактировать или отклонять
|
||||
комментарии, коммиты, код, изменения в вики, вопросы и другой вклад, который не совпадает
|
||||
с Кодексом Поведения, и предоставят причины принятого решения, когда сочтут нужным.
|
||||
|
||||
## Область применения
|
||||
|
||||
Данный Кодекс Поведения применим во всех публичных физических и цифровых пространства сообщества,
|
||||
а также когда человек официально представляет сообщество в публичных местах.
|
||||
Примеры представления проекта или сообщества включают использование официальной электронной почты,
|
||||
публикации в официальном аккаунте в социальных сетях,
|
||||
или упоминания как представителя в онлайн или офлайн мероприятии.
|
||||
|
||||
## Приведение в исполнение
|
||||
|
||||
О случаях домогательства, а так же оскорбительного или иного другого неприемлемого
|
||||
поведения можно сообщить ответственным лидерам сообщества с помощью email.
|
||||
Все жалобы будут рассмотрены и расследованы оперативно и беспристрастно.
|
||||
|
||||
Все лидеры сообщества обязаны уважать неприкосновенность частной жизни и личную
|
||||
неприкосновенность автора сообщения.
|
||||
|
||||
## Атрибуция
|
||||
|
||||
Данный Кодекс Поведения основан на [Кодекс Поведения участника][homepage],
|
||||
версии 2.0, доступной по адресу
|
||||
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
||||
|
||||
Принципы Воздействия в Сообществе были вдохновлены [Mozilla's code of conduct
|
||||
enforcement ladder](https://github.com/mozilla/diversity).
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
|
@ -1,85 +0,0 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const fs = require('fs');
|
||||
const obj = require('through2').obj;
|
||||
const pager = require('default-pager');
|
||||
const msee = require('msee');
|
||||
const join = require('path').join;
|
||||
const boxen = require('boxen');
|
||||
const chalk = require('chalk');
|
||||
const updateNotifier = require('update-notifier');
|
||||
const pkg = require('./package.json');
|
||||
const meow = require('meow');
|
||||
|
||||
const cli = meow([
|
||||
'Usage',
|
||||
' bash-handbook',
|
||||
'',
|
||||
'Options',
|
||||
' --lang, -l Translation language',
|
||||
'',
|
||||
'Examples',
|
||||
' bash-handbook',
|
||||
' bash-handbook --lang pt-br'
|
||||
], {
|
||||
string: [
|
||||
'lang'
|
||||
],
|
||||
alias: {
|
||||
l: 'lang',
|
||||
h: 'help'
|
||||
},
|
||||
default: {
|
||||
lang: ''
|
||||
}
|
||||
});
|
||||
|
||||
const boxenOpts = {
|
||||
borderColor: 'yellow',
|
||||
margin: {
|
||||
bottom: 1
|
||||
},
|
||||
padding: {
|
||||
right: 1,
|
||||
left: 1
|
||||
}
|
||||
};
|
||||
|
||||
const mseeOpts = {
|
||||
paragraphEnd: '\n\n'
|
||||
};
|
||||
|
||||
const notifier = updateNotifier({ pkg });
|
||||
|
||||
process.env.PAGER = process.env.PAGER || 'less';
|
||||
process.env.LESS = process.env.LESS || 'FRX';
|
||||
|
||||
const lang = cli.flags.lang
|
||||
.toLowerCase()
|
||||
.split('-')
|
||||
.map((l, i) => i === 0 ? l : l.toUpperCase())
|
||||
.join('-');
|
||||
|
||||
const translation = join(__dirname, !lang ? './README.md' : `./README-${lang}.md`);
|
||||
|
||||
fs.stat(translation, function (err, stats) {
|
||||
if (err) {
|
||||
console.log('The %s translation does not exist', chalk.bold(lang));
|
||||
return;
|
||||
}
|
||||
|
||||
fs.createReadStream(translation)
|
||||
.pipe(obj(function (chunk, enc, cb) {
|
||||
const message = [];
|
||||
|
||||
if (notifier.update) {
|
||||
message.push(`Update available: {green.bold ${notifier.update.latest}} {dim current: ${notifier.update.current}}`);
|
||||
message.push(`Run {blue npm install -g ${pkg.name}} to update.`);
|
||||
this.push(boxen(message.join('\n'), boxenOpts));
|
||||
}
|
||||
|
||||
this.push(msee.parse(chunk.toString(), mseeOpts));
|
||||
cb();
|
||||
}))
|
||||
.pipe(pager());
|
||||
});
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|||
|
||||
if __name__ == "__main__":
|
||||
setup(name='wtfpython',
|
||||
version='0.1.3',
|
||||
version='0.2',
|
||||
description='What the f*ck Python!',
|
||||
author="Satwik Kansal",
|
||||
maintainer="Satwik Kansal",
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,18 +1,25 @@
|
|||
from os.path import dirname, join, realpath
|
||||
|
||||
import pydoc
|
||||
try:
|
||||
from urllib.request import urlretrieve
|
||||
except ImportError:
|
||||
from urllib import urlretrieve
|
||||
|
||||
url = ("https://raw.githubusercontent.com/satwikkansal/"
|
||||
url = ("http://raw.githubusercontent.com/satwikkansal/"
|
||||
"wtfpython/master/README.md")
|
||||
file_name = "content.md"
|
||||
|
||||
file_path = join(dirname(dirname(realpath(__file__))), "content.md")
|
||||
|
||||
|
||||
def fetch_updated_doc():
|
||||
"""
|
||||
Fetch the latest version of the file at `url` and save it to `file_path`.
|
||||
If anything goes wrong, do nothing.
|
||||
"""
|
||||
try:
|
||||
print("Fetching the latest version...")
|
||||
urlretrieve(url, file_name)
|
||||
urlretrieve(url, file_path)
|
||||
print("Done!")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
@ -21,7 +28,7 @@ def fetch_updated_doc():
|
|||
|
||||
|
||||
def render_doc():
|
||||
with open(file_name, 'r') as f:
|
||||
with open(file_path, 'r', encoding="utf-8") as f:
|
||||
content = f.read()
|
||||
pydoc.pager(content)
|
||||
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue