diff --git a/README.md b/README.md index f5dc7ee..81a9f2d 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Contents **   ** **3. Syntax:** **         ** **[`Args`](#arguments)**__,__ **[`Inline`](#inline)**__,__ **[`Import`](#imports)**__,__ **[`Decorator`](#decorator)**__,__ **[`Class`](#class)**__,__ **[`Duck_Types`](#duck-types)**__,__ **[`Enum`](#enum)**__,__ **[`Exception`](#exceptions)**__.__ **   ** **4. System:** **        ** **[`Exit`](#exit)**__,__ **[`Print`](#print)**__,__ **[`Input`](#input)**__,__ **[`Command_Line_Arguments`](#command-line-arguments)**__,__ **[`Open`](#open)**__,__ **[`Path`](#paths)**__,__ **[`OS_Commands`](#os-commands)**__.__ **   ** **5. Data:** **             ** **[`JSON`](#json)**__,__ **[`Pickle`](#pickle)**__,__ **[`CSV`](#csv)**__,__ **[`SQLite`](#sqlite)**__,__ **[`Bytes`](#bytes)**__,__ **[`Struct`](#struct)**__,__ **[`Array`](#array)**__,__ **[`Memory_View`](#memory-view)**__,__ **[`Deque`](#deque)**__.__ -**   ** **6. Advanced:** **   ** **[`Threading`](#threading)**__,__ **[`Operator`](#operator)**__,__ **[`Match_Stmt`](#match-statement)**__,__ **[`Logging`](#logging)**__,__ **[`Introspection`](#introspection)**__,__ **[`Coroutines`](#coroutines)**__.__ +**   ** **6. Advanced:** **   ** **[`Operator`](#operator)**__,__ **[`Match_Stmt`](#match-statement)**__,__ **[`Logging`](#logging)**__,__ **[`Introspection`](#introspection)**__,__ **[`Threading`](#threading)**__,__ **[`Coroutines`](#coroutines)**__.__ **   ** **7. Libraries:** **      ** **[`Progress_Bar`](#progress-bar)**__,__ **[`Plot`](#plot)**__,__ **[`Table`](#table)**__,__ **[`Console_App`](#console-app)**__,__ **[`GUI`](#gui-app)**__,__ **[`Scraping`](#scraping)**__,__ **[`Web`](#web-app)**__,__ **[`Profile`](#profiling)**__.__ **   ** **8. Multimedia:** **  ** **[`NumPy`](#numpy)**__,__ **[`Image`](#image)**__,__ **[`Animation`](#animation)**__,__ **[`Audio`](#audio)**__,__ **[`Synthesizer`](#synthesizer)**__,__ **[`Pygame`](#pygame)**__,__ **[`Pandas`](#pandas)**__,__ **[`Plotly`](#plotly)**__.__ @@ -2086,7 +2086,7 @@ Memory View Deque ----- -**A thread-safe list with efficient appends and pops from either side. Pronounced "deck".** +**List with efficient appends and pops from either side. Pronounced "deck".** ```python from collections import deque @@ -2101,71 +2101,6 @@ from collections import deque ``` -Threading ---------- -**CPython interpreter can only run a single thread at a time. Using multiple threads won't result in a faster execution, unless at least one of the threads contains an I/O operation.** -```python -from threading import Thread, Lock, RLock, Semaphore, Event, Barrier -from concurrent.futures import ThreadPoolExecutor, as_completed -``` - -### Thread -```python - = Thread(target=) # Use `args=` to set the arguments. -.start() # Starts the thread. Also .is_alive(). -.join() # Waits for the thread to finish. -``` -* **Use `'kwargs='` to pass keyword arguments to the function.** -* **Use `'daemon=True'`, or the program will not be able to exit while the thread is alive.** - -### Lock -```python - = Lock/RLock() # RLock can only be released by acquirer. -.acquire() # Waits for the lock to be available. -.release() # Makes the lock available again. -``` - -#### Or: -```python -with : # Enters the block by calling acquire() and - ... # exits it with release(), even on error. -``` - -### Semaphore, Event, Barrier -```python - = Semaphore(value=1) # Lock that can be acquired by 'value' threads. - = Event() # Method wait() blocks until set() is called. - = Barrier(n_times) # Wait() blocks until it's called n_times. -``` - -### Queue -```python - = queue.Queue(maxsize=0) # A thread-safe first-in-first-out queue. -.put() # Blocks until queue stops being full. -.put_nowait() # Raises queue.Full exception if full. - = .get() # Blocks until queue stops being empty. - = .get_nowait() # Raises queue.Empty exception if empty. -``` - -### Thread Pool Executor -```python - = ThreadPoolExecutor(max_workers=None) # Or: `with ThreadPoolExecutor() as : ...` - = .map(, , ...) # Multithreaded and non-lazy map(). Keeps order. - = .submit(, , ...) # Creates a thread and returns its Future obj. -.shutdown() # Blocks until all threads finish executing. -``` - -```python - = .done() # Checks if the thread has finished executing. - = .result(timeout=None) # Waits for thread to finish and returns result. - = .cancel() # Cancels or returns False if running/finished. - = as_completed() # `next()` returns next completed Future. -``` -* **Map() and as\_completed() also accept 'timeout'. It causes futures.TimeoutError when next() is called/blocking. Map() times from original call and as_completed() from first call to next(). As\_completed() fails if next() is called too late, even if all threads are done.** -* **Exceptions that happen inside threads are raised when map iterator's next() or Future's result() are called. Future's exception() method returns exception object or None.** -* **ProcessPoolExecutor provides true parallelism but: everything sent to/from workers must be [pickable](#pickle), queues must be sent using executor's 'initargs' and 'initializer' parameters, and executor should only be reachable via `'if __name__ == "__main__": ...'`.** - - Operator -------- **Module of functions that provide the functionality of operators. Functions are ordered and grouped by operator precedence from least to most binding. Logical and arithmetic operators in rows 1, 3 and 5 are also ordered by precedence within a group.** @@ -2316,6 +2251,71 @@ delattr(, '') # Deletes attribute from __dict__. Also `del ``` +Threading +--------- +**CPython interpreter can only run a single thread at a time. Using multiple threads won't result in a faster execution, unless at least one of the threads contains an I/O operation.** +```python +from threading import Thread, Lock, RLock, Semaphore, Event, Barrier +from concurrent.futures import ThreadPoolExecutor, as_completed +``` + +### Thread +```python + = Thread(target=) # Use `args=` to set the arguments. +.start() # Starts the thread. Also .is_alive(). +.join() # Waits for the thread to finish. +``` +* **Use `'kwargs='` to pass keyword arguments to the function.** +* **Use `'daemon=True'`, or the program will not be able to exit while the thread is alive.** + +### Lock +```python + = Lock/RLock() # RLock can only be released by acquirer. +.acquire() # Waits for the lock to be available. +.release() # Makes the lock available again. +``` + +#### Or: +```python +with : # Enters the block by calling acquire() and + ... # exits it with release(), even on error. +``` + +### Semaphore, Event, Barrier +```python + = Semaphore(value=1) # Lock that can be acquired by 'value' threads. + = Event() # Method wait() blocks until set() is called. + = Barrier(n_times) # Wait() blocks until it's called n_times. +``` + +### Queue +```python + = queue.Queue(maxsize=0) # A thread-safe first-in-first-out queue. +.put() # Blocks until queue stops being full. +.put_nowait() # Raises queue.Full exception if full. + = .get() # Blocks until queue stops being empty. + = .get_nowait() # Raises queue.Empty exception if empty. +``` + +### Thread Pool Executor +```python + = ThreadPoolExecutor(max_workers=None) # Or: `with ThreadPoolExecutor() as : ...` + = .map(, , ...) # Multithreaded and non-lazy map(). Keeps order. + = .submit(, , ...) # Creates a thread and returns its Future obj. +.shutdown() # Blocks until all threads finish executing. +``` + +```python + = .done() # Checks if the thread has finished executing. + = .result(timeout=None) # Waits for thread to finish and returns result. + = .cancel() # Cancels or returns False if running/finished. + = as_completed() # `next()` returns next completed Future. +``` +* **Map() and as\_completed() also accept 'timeout'. It causes futures.TimeoutError when next() is called/blocking. Map() times from original call and as_completed() from first call to next(). As\_completed() fails if next() is called too late, even if all threads are done.** +* **Exceptions that happen inside threads are raised when map iterator's next() or Future's result() are called. Future's exception() method returns exception object or None.** +* **ProcessPoolExecutor provides true parallelism but: everything sent to/from workers must be [pickable](#pickle), queues must be sent using executor's 'initargs' and 'initializer' parameters, and executor should only be reachable via `'if __name__ == "__main__": ...'`.** + + Coroutines ---------- * **Coroutines have a lot in common with threads, but unlike threads, they only give up control when they call another coroutine and they don’t use as much memory.** @@ -2553,7 +2553,7 @@ import flask as fl ```python app = fl.Flask(__name__) # Returns the app object. Put at the top. -app.run(host=None, port=None, debug=None) # Or: $ flask --app FILE run [--ARG[=VAL] …] +app.run(host=None, port=None, debug=None) # Or: $ flask --app FILE run [--ARG[=VAL]]… ``` * **Starts the app at `'http://localhost:5000'`. Use `'host="0.0.0.0"'` to run externally.** * **Install a WSGI server like [Waitress](https://flask.palletsprojects.com/en/latest/deploying/waitress/) and a HTTP server such as [Nginx](https://flask.palletsprojects.com/en/latest/deploying/nginx/) for better security.** @@ -3146,7 +3146,7 @@ if __name__ == '__main__': Pandas ------ -**Data analysis library. For examples see [Plotly](#displays-a-line-chart-of-total-coronavirus-deaths-per-million-grouped-by-continent).** +**Data analysis library. For examples see [Plotly](#plotly).** ```python # $ pip3 install pandas matplotlib diff --git a/index.html b/index.html index 307c470..75852dc 100644 --- a/index.html +++ b/index.html @@ -86,7 +86,7 @@ '3. Syntax': [Args, Inline, Import, Decorator, Class, Duck_Types, Enum, Exception], '4. System': [Exit, Print, Input, Command_Line_Arguments, Open, Path, OS_Commands], '5. Data': [JSON, Pickle, CSV, SQLite, Bytes, Struct, Array, Memory_View, Deque], - '6. Advanced': [Threading, Operator, Match_Stmt, Logging, Introspection, Coroutines], + '6. Advanced': [Operator, Match_Stmt, Logging, Introspection, Threading, Coroutines], '7. Libraries': [Progress_Bar, Plot, Table, Console_App, GUI, Scraping, Web, Profile], '8. Multimedia': [NumPy, Image, Animation, Audio, Synthesizer, Pygame, Pandas, Plotly] } @@ -1714,7 +1714,7 @@ CompletedProcess(args=['bc', 'utf-8') # Treats memoryview as a bytes object. <str> = <mview>.hex() # Returns hex pairs. Accepts `sep=<str>`. -

#Deque

A thread-safe list with efficient appends and pops from either side. Pronounced "deck".

from collections import deque
+

#Deque

List with efficient appends and pops from either side. Pronounced "deck".

from collections import deque
 
@@ -1724,57 +1724,6 @@ CompletedProcess(args=['bc', 1) # Last element becomes first. <el> = <deque>.popleft() # Raises IndexError if deque is empty.
-

#Threading

CPython interpreter can only run a single thread at a time. Using multiple threads won't result in a faster execution, unless at least one of the threads contains an I/O operation.

from threading import Thread, Lock, RLock, Semaphore, Event, Barrier
-from concurrent.futures import ThreadPoolExecutor, as_completed
-
- - -

Thread

<Thread> = Thread(target=<function>)           # Use `args=<collection>` to set the arguments.
-<Thread>.start()                               # Starts the thread. Also <Thread>.is_alive().
-<Thread>.join()                                # Waits for the thread to finish.
-
- -
    -
  • Use 'kwargs=<dict>' to pass keyword arguments to the function.
  • -
  • Use 'daemon=True', or the program will not be able to exit while the thread is alive.
  • -
-

Lock

<lock> = Lock/RLock()                          # RLock can only be released by acquirer.
-<lock>.acquire()                               # Waits for the lock to be available.
-<lock>.release()                               # Makes the lock available again.
-
- -

Or:

with <lock>:                                   # Enters the block by calling acquire() and
-    ...                                        # exits it with release(), even on error.
-
- -

Semaphore, Event, Barrier

<Semaphore> = Semaphore(value=1)               # Lock that can be acquired by 'value' threads.
-<Event>     = Event()                          # Method wait() blocks until set() is called.
-<Barrier>   = Barrier(n_times)                 # Wait() blocks until it's called n_times.
-
- -

Queue

<Queue> = queue.Queue(maxsize=0)               # A thread-safe first-in-first-out queue.
-<Queue>.put(<el>)                              # Blocks until queue stops being full.
-<Queue>.put_nowait(<el>)                       # Raises queue.Full exception if full.
-<el> = <Queue>.get()                           # Blocks until queue stops being empty.
-<el> = <Queue>.get_nowait()                    # Raises queue.Empty exception if empty.
-
- -

Thread Pool Executor

<Exec> = ThreadPoolExecutor(max_workers=None)  # Or: `with ThreadPoolExecutor() as <name>: ...`
-<iter> = <Exec>.map(<func>, <args_1>, ...)     # Multithreaded and non-lazy map(). Keeps order.
-<Futr> = <Exec>.submit(<func>, <arg_1>, ...)   # Creates a thread and returns its Future obj.
-<Exec>.shutdown()                              # Blocks until all threads finish executing.
-
- -
<bool> = <Future>.done()                       # Checks if the thread has finished executing.
-<obj>  = <Future>.result(timeout=None)         # Waits for thread to finish and returns result.
-<bool> = <Future>.cancel()                     # Cancels or returns False if running/finished.
-<iter> = as_completed(<coll_of_Futures>)       # `next(<iter>)` returns next completed Future.
-
-
    -
  • Map() and as_completed() also accept 'timeout'. It causes futures.TimeoutError when next() is called/blocking. Map() times from original call and as_completed() from first call to next(). As_completed() fails if next() is called too late, even if all threads are done.
  • -
  • Exceptions that happen inside threads are raised when map iterator's next() or Future's result() are called. Future's exception() method returns exception object or None.
  • -
  • ProcessPoolExecutor provides true parallelism but: everything sent to/from workers must be pickable, queues must be sent using executor's 'initargs' and 'initializer' parameters, and executor should only be reachable via 'if __name__ == "__main__": ...'.
  • -

#Operator

Module of functions that provide the functionality of operators. Functions are ordered and grouped by operator precedence from least to most binding. Logical and arithmetic operators in rows 1, 3 and 5 are also ordered by precedence within a group.

import operator as op
 
@@ -1894,6 +1843,57 @@ delattr(<obj>, '<name>') <memb> = <Param>.kind # Returns ParameterKind member (Parameter.KEYWORD_ONLY, …). <type> = <Param>.annotation # Returns Parameter.empty if missing. Also <Param>.default. +

#Threading

CPython interpreter can only run a single thread at a time. Using multiple threads won't result in a faster execution, unless at least one of the threads contains an I/O operation.

from threading import Thread, Lock, RLock, Semaphore, Event, Barrier
+from concurrent.futures import ThreadPoolExecutor, as_completed
+
+ + +

Thread

<Thread> = Thread(target=<function>)           # Use `args=<collection>` to set the arguments.
+<Thread>.start()                               # Starts the thread. Also <Thread>.is_alive().
+<Thread>.join()                                # Waits for the thread to finish.
+
+ +
    +
  • Use 'kwargs=<dict>' to pass keyword arguments to the function.
  • +
  • Use 'daemon=True', or the program will not be able to exit while the thread is alive.
  • +
+

Lock

<lock> = Lock/RLock()                          # RLock can only be released by acquirer.
+<lock>.acquire()                               # Waits for the lock to be available.
+<lock>.release()                               # Makes the lock available again.
+
+ +

Or:

with <lock>:                                   # Enters the block by calling acquire() and
+    ...                                        # exits it with release(), even on error.
+
+ +

Semaphore, Event, Barrier

<Semaphore> = Semaphore(value=1)               # Lock that can be acquired by 'value' threads.
+<Event>     = Event()                          # Method wait() blocks until set() is called.
+<Barrier>   = Barrier(n_times)                 # Wait() blocks until it's called n_times.
+
+ +

Queue

<Queue> = queue.Queue(maxsize=0)               # A thread-safe first-in-first-out queue.
+<Queue>.put(<el>)                              # Blocks until queue stops being full.
+<Queue>.put_nowait(<el>)                       # Raises queue.Full exception if full.
+<el> = <Queue>.get()                           # Blocks until queue stops being empty.
+<el> = <Queue>.get_nowait()                    # Raises queue.Empty exception if empty.
+
+ +

Thread Pool Executor

<Exec> = ThreadPoolExecutor(max_workers=None)  # Or: `with ThreadPoolExecutor() as <name>: ...`
+<iter> = <Exec>.map(<func>, <args_1>, ...)     # Multithreaded and non-lazy map(). Keeps order.
+<Futr> = <Exec>.submit(<func>, <arg_1>, ...)   # Creates a thread and returns its Future obj.
+<Exec>.shutdown()                              # Blocks until all threads finish executing.
+
+ +
<bool> = <Future>.done()                       # Checks if the thread has finished executing.
+<obj>  = <Future>.result(timeout=None)         # Waits for thread to finish and returns result.
+<bool> = <Future>.cancel()                     # Cancels or returns False if running/finished.
+<iter> = as_completed(<coll_of_Futures>)       # `next(<iter>)` returns next completed Future.
+
+
    +
  • Map() and as_completed() also accept 'timeout'. It causes futures.TimeoutError when next() is called/blocking. Map() times from original call and as_completed() from first call to next(). As_completed() fails if next() is called too late, even if all threads are done.
  • +
  • Exceptions that happen inside threads are raised when map iterator's next() or Future's result() are called. Future's exception() method returns exception object or None.
  • +
  • ProcessPoolExecutor provides true parallelism but: everything sent to/from workers must be pickable, queues must be sent using executor's 'initargs' and 'initializer' parameters, and executor should only be reachable via 'if __name__ == "__main__": ...'.
  • +

#Coroutines

  • Coroutines have a lot in common with threads, but unlike threads, they only give up control when they call another coroutine and they don’t use as much memory.
  • Coroutine definition starts with 'async' and its call with 'await'.
  • @@ -2087,7 +2087,7 @@ print(f'{python_url},
    app = fl.Flask(__name__)                   # Returns the app object. Put at the top.
    -app.run(host=None, port=None, debug=None)  # Or: $ flask --app FILE run [--ARG[=VAL] …]
    +app.run(host=None, port=None, debug=None)  # Or: $ flask --app FILE run [--ARG[=VAL]]…
     
    • Starts the app at 'http://localhost:5000'. Use 'host="0.0.0.0"' to run externally.
    • @@ -2568,7 +2568,7 @@ W, H, MAX_S = 50, 50< main()
-

#Pandas

Data analysis library. For examples see Plotly.

# $ pip3 install pandas matplotlib
+

#Pandas

Data analysis library. For examples see Plotly.

# $ pip3 install pandas matplotlib
 import pandas as pd, matplotlib.pyplot as plt
 
diff --git a/parse.js b/parse.js index cc1725e..3f82617 100755 --- a/parse.js +++ b/parse.js @@ -36,7 +36,7 @@ const TOC = ' \'3. Syntax\': [Args, Inline, Import, Decorator, Class, Duck_Types, Enum, Exception],\n' + ' \'4. System\': [Exit, Print, Input, Command_Line_Arguments, Open, Path, OS_Commands],\n' + ' \'5. Data\': [JSON, Pickle, CSV, SQLite, Bytes, Struct, Array, Memory_View, Deque],\n' + - ' \'6. Advanced\': [Threading, Operator, Match_Stmt, Logging, Introspection, Coroutines],\n' + + ' \'6. Advanced\': [Operator, Match_Stmt, Logging, Introspection, Threading, Coroutines],\n' + ' \'7. Libraries\': [Progress_Bar, Plot, Table, Console_App, GUI, Scraping, Web, Profile],\n' + ' \'8. Multimedia\': [NumPy, Image, Animation, Audio, Synthesizer, Pygame, Pandas, Plotly]\n' + '}\n' + @@ -711,7 +711,6 @@ function getMd() { var readme = readme.replace("#semaphore-event-barrier", "#semaphoreeventbarrier"); var readme = readme.replace("#semaphore-event-barrier", "#semaphoreeventbarrier"); var readme = readme.replace("#dataframe-plot-encode-decode", "#dataframeplotencodedecode"); - var readme = readme.replace("#displays-a-line-chart-of-total-coronavirus-deaths-per-million-grouped-by-continent", "#displaysalinechartoftotalcoronavirusdeathspermilliongroupedbycontinent"); const converter = new showdown.Converter(); return converter.makeHtml(readme); } diff --git a/pdf/index_for_pdf.html b/pdf/index_for_pdf.html index 54f6747..44050ad 100644 --- a/pdf/index_for_pdf.html +++ b/pdf/index_for_pdf.html @@ -14,7 +14,7 @@

B

beautifulsoup library, 35
binary representation, 7, 8
-bitwise operators, 8, 31
+bitwise operators, 8, 30
bytes, 22-23, 25, 28-29

C

cache, 13
@@ -26,7 +26,7 @@ combinatorics, 8
command line arguments, 22
comprehensions, 11
-context manager, 17, 23, 27, 30
+context manager, 17, 23, 27, 32
copy function, 15
coroutine, 33
counter, 2, 4, 12, 17
@@ -44,7 +44,7 @@

enum module, 19-20
enumerate function, 3
excel, 46
-exceptions, 20-21, 23, 32
+exceptions, 20-21, 23, 31
exit function, 21

F

files, 22-29, 34, 46
@@ -66,9 +66,9 @@ imports, 12
inline, 11, 15, 20
input function, 22
-introspection, 21, 32
+introspection, 21, 31
ints, 4, 7, 8, 28
-is operator, 16, 31
+is operator, 16, 30
iterable, 4, 18, 19
iterator, 3-4, 11, 17
itertools module, 3, 8

@@ -78,12 +78,12 @@

lambda, 11
lists, 1-2, 4, 11, 18-19, 21
locale module, 16
-logging, 32

+logging, 31

M

main function, 1, 49
-match statement, 31
+match statement, 30
matplotlib library, 34, 44, 46
-map function, 11, 31
+map function, 11, 30
math module, 7
memoryviews, 29
module, 12

@@ -94,7 +94,7 @@ numpy library, 37-38

O

open function, 17, 22-23, 25, 26, 28
-operator module, 31
+operator module, 30
os commands, 23-25, 34

P

pandas library, 44-48
@@ -109,12 +109,12 @@ property decorator, 15
pygame library, 42-43

Q

-

queues, 29, 30, 33

+

queues, 29, 32, 33

R

random module, 8
ranges, 3, 4
recursion, 13, 21
-reduce function, 11, 31
+reduce function, 11
regular expressions, 5-6
requests library, 35, 36

S

@@ -136,11 +136,11 @@

T

table, 26, 27, 34, 37-38, 45-46
template, 6, 36
-threading module, 30, 36
+threading module, 32, 36
time module, 34, 36
tuples, 3, 4, 11, 18-19
type, 4
-type annotations, 15, 32

+type annotations, 15, 31

W

wave module, 40-41
web, 36

diff --git a/pdf/index_for_pdf_print.html b/pdf/index_for_pdf_print.html index e7bdcfe..126dbf0 100644 --- a/pdf/index_for_pdf_print.html +++ b/pdf/index_for_pdf_print.html @@ -14,7 +14,7 @@

B

beautifulsoup library, 35
binary representation, 7, 8
-bitwise operators, 8, 31
+bitwise operators, 8, 30
bytes, 22-23, 25, 28-29

C

cache, 13
@@ -26,7 +26,7 @@ combinatorics, 8
command line arguments, 22
comprehensions, 11
-context manager, 17, 23, 27, 30
+context manager, 17, 23, 27, 32
copy function, 15
coroutine, 33
counter, 2, 4, 12, 17
@@ -44,7 +44,7 @@

enum module, 19-20
enumerate function, 3
excel, 46
-exceptions, 20-21, 23, 32
+exceptions, 20-21, 23, 31
exit function, 21

F

files, 22-29, 34, 46
@@ -66,9 +66,9 @@ imports, 12
inline, 11, 15, 20
input function, 22
-introspection, 21, 32
+introspection, 21, 31
ints, 4, 7, 8, 28
-is operator, 16, 31
+is operator, 16, 30
iterable, 4, 18, 19
iterator, 3-4, 11, 17
itertools module, 3, 8

@@ -78,12 +78,12 @@

lambda, 11
lists, 1-2, 4, 11, 18-19, 21
locale module, 16
-logging, 32

+logging, 31

M

main function, 1, 49
-match statement, 31
+match statement, 30
matplotlib library, 34, 44, 46
-map function, 11, 31
+map function, 11, 30
math module, 7
memoryviews, 29
module, 12

@@ -94,7 +94,7 @@ numpy library, 37-38

O

open function, 17, 22-23, 25, 26, 28
-operator module, 31
+operator module, 30
os commands, 23-25, 34

P

pandas library, 44-48
@@ -109,12 +109,12 @@ property decorator, 15
pygame library, 42-43

Q

-

queues, 29, 30, 33

+

queues, 29, 32, 33

R

random module, 8
ranges, 3, 4
recursion, 13, 21
-reduce function, 11, 31
+reduce function, 11
regular expressions, 5-6
requests library, 35, 36

S

@@ -136,11 +136,11 @@

T

table, 26, 27, 34, 37-38, 45-46
template, 6, 36
-threading module, 30, 36
+threading module, 32, 36
time module, 34, 36
tuples, 3, 4, 11, 18-19
type, 4
-type annotations, 15, 32

+type annotations, 15, 31

W

wave module, 40-41
web, 36

diff --git a/pdf/remove_links.py b/pdf/remove_links.py index e31507e..329238d 100755 --- a/pdf/remove_links.py +++ b/pdf/remove_links.py @@ -20,15 +20,14 @@ MATCHES = { 'Objects returned by the itertools module, such as count, repeat and cycle.': 'Objects returned by the itertools module, such as count, repeat and cycle (p. 3).', 'Generators returned by the generator functions and generator expressions.': 'Generators returned by the generator functions (p. 4) and generator expressions (p. 11).', 'File objects returned by the open() function, etc.': 'File objects returned by the open() function (p. 22), etc.', - 'Use \'logging.exception(<str>)\' to log the passed message, followed by the full error message of the caught exception. For details see logging.': 'Use \'logging.exception(<str>)\' to log the passed message, followed by the full error message of the caught exception. For details see logging (p. 32).', + 'Use \'logging.exception(<str>)\' to log the passed message, followed by the full error message of the caught exception. For details see logging.': 'Use \'logging.exception(<str>)\' to log the passed message, followed by the full error message of the caught exception. For details see logging (p. 31).', 'Functions report OS related errors by raising either OSError or one of its subclasses.': 'Functions report OS related errors by raising OSError or one of its subclasses (p. 23).', 'To print the spreadsheet to the console use Tabulate library.': 'To print the spreadsheet to the console use Tabulate library (p. 34).', 'For XML and binary Excel files (xlsx, xlsm and xlsb) use Pandas library.': 'For XML and binary Excel files (xlsx, xlsm and xlsb) use Pandas library (p. 46).', 'Bools will be stored and returned as ints and dates as ISO formatted strings.': 'Bools will be stored and returned as ints and dates as ISO formatted strings (p. 9).', 'ProcessPoolExecutor provides true parallelism but: everything sent to/from workers must be pickable, queues must be sent using executor\'s \'initargs\' and \'initializer\' parameters, and executor should only be reachable via \'if __name__ == "__main__": ...\'.': 'ProcessPoolExecutor provides true parallelism but: everything sent to/from workers must be pickable, queues must be sent using executor\'s \'initargs\' and \'initializer\' parameters, and executor should only be reachable via \'if __name__ == "__main__": ...\'.', - 'Asyncio module also provides its own Queue, Event, Lock and Semaphore classes.': 'Asyncio module also provides its own Queue, Event, Lock and Semaphore classes (p. 30).', 'Install a WSGI server like Waitress and a HTTP server such as Nginx for better security.': 'Install a WSGI server like Waitress and a HTTP server such as Nginx for better security.', - 'Data analysis library. For examples see Plotly.': 'Data analysis library. For examples see Plotly (p. 47).', + 'Data analysis library. For examples see Plotly.': 'Data analysis library. For examples see Plotly (p. 47).', } diff --git a/web/script_2.js b/web/script_2.js index be1c1c7..673fc18 100644 --- a/web/script_2.js +++ b/web/script_2.js @@ -5,7 +5,7 @@ const TOC = ' \'3. Syntax\': [Args, Inline, Import, Decorator, Class, Duck_Types, Enum, Exception],\n' + ' \'4. System\': [Exit, Print, Input, Command_Line_Arguments, Open, Path, OS_Commands],\n' + ' \'5. Data\': [JSON, Pickle, CSV, SQLite, Bytes, Struct, Array, Memory_View, Deque],\n' + - ' \'6. Advanced\': [Threading, Operator, Match_Stmt, Logging, Introspection, Coroutines],\n' + + ' \'6. Advanced\': [Operator, Match_Stmt, Logging, Introspection, Threading, Coroutines],\n' + ' \'7. Libraries\': [Progress_Bar, Plot, Table, Console_App, GUI, Scraping, Web, Profile],\n' + ' \'8. Multimedia\': [NumPy, Image, Animation, Audio, Synthesizer, Pygame, Pandas, Plotly]\n' + '}\n'; @@ -27,9 +27,9 @@ const TOC_MOBILE = ' \'5. Data\': [JSON, Pickle, CSV, SQLite,\n' + ' Bytes, Struct, Array,\n' + ' Memory_View, Deque],\n' + - ' \'6. Advanced\': [Threading, Operator,\n' + - ' Match_Stmt, Logging, \n' + - ' Introspection, Coroutines],\n' + + ' \'6. Advanced\': [, Operator, Match_Stmt,\n' + + ' Logging, Introspection,\n' + + ' Threading, Coroutines],\n' + ' \'7. Libraries\': [Progress_Bar, Plot, Table,\n' + ' Console_App, GUI_App,\n' + ' Scraping, Web, Profiling],\n' +