From e2b3bb2b9e05013a5f0ba1d5429ef26426a9c084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sat, 21 Nov 2020 00:27:15 +0100 Subject: [PATCH] Exceptions, progress bar and index --- README.md | 8 +++++--- index.html | 7 ++++--- parse.js | 7 ++++--- pdf/index_for_pdf.html | 23 +++++++++++------------ pdf/index_for_pdf_print.html | 17 ++++++++--------- 5 files changed, 32 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 701d0da..5504567 100644 --- a/README.md +++ b/README.md @@ -1414,7 +1414,8 @@ BaseException | +-- IndexError # Raised when a sequence index is out of range. | +-- KeyError # Raised when a dictionary key or set element is not found. +-- NameError # Raised when a variable name is not found. - +-- OSError # Failures such as “file not found” or “disk full”. + +-- OSError # Errors such as “file not found” or “disk full” (see Open). + | +-- FileNotFoundError # When a file or directory is requested but doesn't exist. +-- RuntimeError # Raised by errors that don't fall into other categories. | +-- RecursionError # Raised when the maximum recursion depth is exceeded. @@ -2333,9 +2334,10 @@ Progress Bar ```python # $ pip3 install tqdm >>> from tqdm import tqdm +>>> from time import sleep >>> for el in tqdm([1, 2, 3], desc='Processing'): -... pass -Processing: 100%|██████████████████| 3/3 [00:00<00:00, 11516.49it/s] +... sleep(1) +Processing: 100%|██████████████████| 3/3 [00:03<00:00, 1.00s/it] ``` diff --git a/index.html b/index.html index c7ed4f2..c6f8276 100644 --- a/index.html +++ b/index.html @@ -1343,7 +1343,7 @@ error_msg = ''.join(traceback.format_exception( │ ├── IndexError # Raised when a sequence index is out of range. │ └── KeyError # Raised when a dictionary key or set element is not found. ├── NameError # Raised when a variable name is not found. - ├── OSError # Failures such as “file not found” or “disk full”. + ├── OSError # Errors such as “file not found” or “disk full” (see Open). │ └── FileNotFoundError # When a file or directory is requested but doesn't exist. ├── RuntimeError # Raised by errors that don't fall in other categories. │ └── RecursionError # Raised when the maximum recursion depth is exceeded. @@ -2038,9 +2038,10 @@ curses.wrapper(main)


Libraries

#Progress Bar

# $ pip3 install tqdm
 >>> from tqdm import tqdm
+>>> from time import sleep
 >>> for el in tqdm([1, 2, 3], desc='Processing'):
-...     pass
-Processing: 100%|██████████████████| 3/3 [00:00<00:00, 11516.49it/s]
+...     sleep(1)
+Processing: 100%|███████████████████| 3/3 [00:03<00:00,  1.00s/it]
 
diff --git a/parse.js b/parse.js index 027356f..b212172 100755 --- a/parse.js +++ b/parse.js @@ -66,9 +66,10 @@ const EVAL = const PROGRESS_BAR = '# $ pip3 install tqdm\n' + '>>> from tqdm import tqdm\n' + + '>>> from time import sleep\n' + '>>> for el in tqdm([1, 2, 3], desc=\'Processing\'):\n' + - '... pass\n' + - 'Processing: 100%|██████████████████| 3/3 [00:00<00:00, 11516.49it/s]\n'; + '... sleep(1)\n' + + 'Processing: 100%|███████████████████| 3/3 [00:03<00:00, 1.00s/it]\n'; const PYINSTALLER = '$ pip3 install pyinstaller\n' + @@ -200,7 +201,7 @@ const DIAGRAM_7_B = " │ ├── IndexError # Raised when a sequence index is out of range.\n" + " │ └── KeyError # Raised when a dictionary key or set element is not found.\n" + " ├── NameError # Raised when a variable name is not found.\n" + - " ├── OSError # Failures such as “file not found” or “disk full”.\n" + + " ├── OSError # Errors such as “file not found” or “disk full” (see Open).\n" + " │ └── FileNotFoundError # When a file or directory is requested but doesn't exist.\n" + " ├── RuntimeError # Raised by errors that don't fall in other categories.\n" + " │ └── RecursionError # Raised when the maximum recursion depth is exceeded.\n" + diff --git a/pdf/index_for_pdf.html b/pdf/index_for_pdf.html index 41df90d..0956c50 100644 --- a/pdf/index_for_pdf.html +++ b/pdf/index_for_pdf.html @@ -5,16 +5,15 @@

A

abstract base classes, 4, 19
-all function, 11
-animation, 40
-any function, 11
+animation, 40, 42-43
argparse module, 22
-arguments, 10
-arrays, 29
-audio, 40-41

+arguments, 10, 12
+arrays, 29, 37-38
+asyncio module, 33
+audio, 40-41, 42

B

beautifulsoup library, 35
-binary representation, 8
+binary representation, 7, 8
bitwise operators, 8
bottle library, 36
bytes, 28

@@ -23,8 +22,8 @@ callable, 17
class, 4, 14-19, 31-32
closure, 12
-collection, 4, 18
-collections module, 2, 3, 4, 19, 29
+collection, 4, 18, 19
+collections module, 2, 3, 4, 19, 29
combinatorics, 8
command line arguments, 22
comparable, 16
@@ -107,7 +106,7 @@ profiling, 36-37
progress bar, 34
property decorator, 15
-pygame library, 42

+pygame library, 42-43

Q

queues, 30

R

@@ -129,8 +128,8 @@ sqlite module, 27
statistics module, 7
strings, 5
-struct module, 28-29
-subprocess module, 25
+struct module, 28-29
+subprocess module, 25
super function, 14
synthesizer, 41
sys module, 15, 21, 22

diff --git a/pdf/index_for_pdf_print.html b/pdf/index_for_pdf_print.html index 27063db..8808ba7 100644 --- a/pdf/index_for_pdf_print.html +++ b/pdf/index_for_pdf_print.html @@ -5,16 +5,15 @@

A

abstract base classes, 4, 19
-all function, 11
-animation, 40
-any function, 11
+animation, 40, 42-43
argparse module, 22
-arguments, 10
-arrays, 29
-audio, 40-41

+arguments, 10, 12
+arrays, 29, 37-38
+asyncio module, 33
+audio, 40-41, 42

B

beautifulsoup library, 35
-binary representation, 8
+binary representation, 7, 8
bitwise operators, 8
bottle library, 36
bytes, 28

@@ -23,7 +22,7 @@ callable, 17
class, 4, 14-19, 31-32
closure, 12
-collection, 4, 18
+collection, 4, 18, 19
collections module, 2, 3, 4, 19, 29
combinatorics, 8
command line arguments, 22
@@ -107,7 +106,7 @@ profiling, 36-37
progress bar, 34
property decorator, 15
-pygame library, 42

+pygame library, 42-43

Q

queues, 30

R