2017-12-02 22:02:37 +00:00
|
|
|
Snippets
|
2019-08-06 07:30:14 +00:00
|
|
|
========
|
2017-12-02 22:02:37 +00:00
|
|
|
|
2019-08-06 07:30:14 +00:00
|
|
|
Hello world
|
|
|
|
-----------
|
2017-12-02 22:02:37 +00:00
|
|
|
|
2019-08-06 07:30:14 +00:00
|
|
|
.. code:: python3
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
print("Hello, world!")
|
|
|
|
|
|
|
|
Directories
|
|
|
|
-----------
|
|
|
|
|
|
|
|
Remove
|
|
|
|
^^^^^^
|
2017-12-02 22:02:37 +00:00
|
|
|
|
|
|
|
.. code:: python3
|
|
|
|
|
2019-08-06 07:30:14 +00:00
|
|
|
import shutil
|
|
|
|
shutil.rmtree(path)
|
2017-12-02 22:02:37 +00:00
|
|
|
|
|
|
|
Web
|
2019-08-06 07:30:14 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
Get
|
|
|
|
^^^
|
2017-12-02 22:02:37 +00:00
|
|
|
|
|
|
|
.. code:: python3
|
|
|
|
|
2019-08-06 07:30:14 +00:00
|
|
|
requests.get(url).content.decode(charset)
|