diff --git a/README.md b/README.md index 1953f29..b30c923 100644 --- a/README.md +++ b/README.md @@ -2496,7 +2496,7 @@ def send_page(sport): ### REST Request ```python -@post('/odds/') +@post('//odds') def odds_handler(sport): team = request.forms.get('team') home_odds, away_odds = 2.44, 3.29 @@ -2510,7 +2510,7 @@ def odds_handler(sport): # $ pip3 install requests >>> import threading, requests >>> threading.Thread(target=run, daemon=True).start() ->>> url = 'http://localhost:8080/odds/football' +>>> url = 'http://localhost:8080/football/odds' >>> data = {'team': 'arsenal f.c.'} >>> response = requests.post(url, data=data) >>> response.json() @@ -2577,11 +2577,10 @@ Line # Mem usage Increment Line Contents ### Call Graph #### Generates a PNG image of a call graph with highlighted bottlenecks: ```python -# $ pip3 install pycallgraph -from pycallgraph import output, PyCallGraph +# $ pip3 install pycallgraph2 +from pycallgraph2 import output, PyCallGraph from datetime import datetime -time_str = datetime.now().strftime('%Y%m%d%H%M%S') -filename = f'profile-{time_str}.png' +filename = f'profile-{datetime.now():%Y%m%d%H%M%S}.png' drawer = output.GraphvizOutput(output_file=filename) with PyCallGraph(drawer): @@ -2961,14 +2960,14 @@ while all(event.type != pg.QUIT for event in pg.event.get()): ``` ```python -from pygame.transform import scale, … +from pygame.transform import scale, ... = scale(, (width, height)) # Returns scaled surface. = rotate(, degrees) # Returns rotated and scaled surface. = flip(, x_bool, y_bool) # Returns flipped surface. ``` ```python -from pygame.draw import line, … +from pygame.draw import line, ... line(, color, (x1, y1), (x2, y2), width) # Draws a line to the surface. arc(, color, , from_rad, to_rad) # Also: ellipse(, color, ) rect(, color, ) # Also: polygon(, color, points) diff --git a/index.html b/index.html index 820e084..d8f6b6d 100644 --- a/index.html +++ b/index.html @@ -2184,7 +2184,7 @@ run(host='0.0.0.0', port=return template('<h1>{{title}}</h1>', title=sport) -

REST Request

@post('/odds/<sport>')
+

REST Request

@post('/<sport>/odds')
 def odds_handler(sport):
     team = request.forms.get('team')
     home_odds, away_odds = 2.44, 3.29
@@ -2196,7 +2196,7 @@ run(host='0.0.0.0', port=Test:
# $ pip3 install requests
 >>> import threading, requests
 >>> threading.Thread(target=run, daemon=True).start()
->>> url = 'http://localhost:8080/odds/football'
+>>> url = 'http://localhost:8080/football/odds'
 >>> data = {'team': 'arsenal f.c.'}
 >>> response = requests.post(url, data=data)
 >>> response.json()
@@ -2246,11 +2246,10 @@ Line #         Mem usage      Increment   Line Contents
      3        38.012 MiB      0.344 MiB       a = [*range(10000)]
      4        38.477 MiB      0.465 MiB       b = {*range(10000)}
 
-

Call Graph

Generates a PNG image of a call graph with highlighted bottlenecks:

# $ pip3 install pycallgraph
-from pycallgraph import output, PyCallGraph
+

Call Graph

Generates a PNG image of a call graph with highlighted bottlenecks:

# $ pip3 install pycallgraph2
+from pycallgraph2 import output, PyCallGraph
 from datetime import datetime
-time_str = datetime.now().strftime('%Y%m%d%H%M%S')
-filename = f'profile-{time_str}.png'
+filename = f'profile-{datetime.now():%Y%m%d%H%M%S}.png'
 drawer = output.GraphvizOutput(output_file=filename)
 with PyCallGraph(drawer):
     <code_to_be_profiled>
@@ -2547,12 +2546,12 @@ rect = pg.Rect(240, 2
 <Surf>.set_at((x, y), color)                    # Updates pixel.
 <Surf>.blit(<Surf>, (x, y))                     # Draws passed surface to the surface.
 
-
from pygame.transform import scale, …
+
from pygame.transform import scale, ...
 <Surf> = scale(<Surf>, (width, height))         # Returns scaled surface.
 <Surf> = rotate(<Surf>, degrees)                # Returns rotated and scaled surface.
 <Surf> = flip(<Surf>, x_bool, y_bool)           # Returns flipped surface.
 
-
from pygame.draw import line, …
+
from pygame.draw import line, ...
 line(<Surf>, color, (x1, y1), (x2, y2), width)  # Draws a line to the surface.
 arc(<Surf>, color, <Rect>, from_rad, to_rad)    # Also: ellipse(<Surf>, color, <Rect>)
 rect(<Surf>, color, <Rect>)                     # Also: polygon(<Surf>, color, points)
diff --git a/pdf/index_for_pdf.html b/pdf/index_for_pdf.html
index afd9e5c..192cb16 100644
--- a/pdf/index_for_pdf.html
+++ b/pdf/index_for_pdf.html
@@ -51,7 +51,7 @@
 

files, 22-29, 34, 46
filter function, 11
floats, 4, 6, 7
-format, 6-7
+format, 6-7, 37
functools module, 11, 12, 13, 16
futures, 30

G

diff --git a/pdf/index_for_pdf_print.html b/pdf/index_for_pdf_print.html index 84a1d47..5d9519c 100644 --- a/pdf/index_for_pdf_print.html +++ b/pdf/index_for_pdf_print.html @@ -51,7 +51,7 @@

files, 22-29, 34, 46
filter function, 11
floats, 4, 6, 7
-format, 6-7
+format, 6-7, 37
functools module, 11, 12, 13, 16
futures, 30

G