diff --git a/README.md b/README.md index 9902ef3..78172d3 100644 --- a/README.md +++ b/README.md @@ -1712,7 +1712,7 @@ import os, shutil, subprocess ```python os.chdir() # Changes the current working directory. os.mkdir(, mode=0o777) # Creates a directory. Permissions are in octal. -os.makedirs(, mode=0o777) # Creates all path's dirs. Also: `exist_ok=False`. +os.makedirs(, mode=0o777) # Creates all path's dirs. Also `exist_ok=False`. ``` ```python @@ -2499,7 +2499,7 @@ logging.basicConfig( >>> logger.addHandler(handler) >>> logger.critical('Running out of disk space.') CRITICAL:my_module:Running out of disk space. ->>> open('test.log').read() +>>> print(open('test.log').read()) 2023-02-07 23:21:01,430 CRITICAL:my_module:Running out of disk space. ``` @@ -3020,13 +3020,13 @@ while not pg.event.get(pg.QUIT): = pg.display.set_mode((width, height)) # Opens new window and returns its surface. = pg.Surface((width, height)) # New RGB surface. RGBA if `flags=pg.SRCALPHA`. = pg.image.load() # Loads the image. Format depends on source. - = pg.surfarray.make_surface() # Also ` = surfarray.pixels3d()`. + = pg.surfarray.make_surface() # Also ` = surfarray.pixels3d()`. = .subsurface() # Returns a subsurface. ``` ```python .fill(color) # Tuple, Color('#rrggbb[aa]') or Color(). -.set_at((x, y), color) # Updates pixel. +.set_at((x, y), color) # Updates pixel. Also .get_at((x, y)). .blit(, (x, y)) # Draws passed surface to the surface. ``` @@ -3357,7 +3357,7 @@ plt.show() # Displays the plot. Also plt.sav ```python = .to_dict(['d/l/s/…']) # Returns columns as dicts, lists or series. = .to_json/html/csv([]) # Also to_markdown/latex([]). -.to_pickle/excel() # Run `$ pip3 install openpyxl` for xlsx files. +.to_pickle/excel() # Run `$ pip3 install "pandas[excel]" odfpy`. .to_sql('', ) # Accepts SQLite3 or SQLAlchemy connection. ``` diff --git a/index.html b/index.html index dad4cd6..eeba12b 100644 --- a/index.html +++ b/index.html @@ -54,7 +54,7 @@
- +
@@ -1439,7 +1439,7 @@ value = args.<name>
os.chdir(<path>)                    # Changes the current working directory.
 os.mkdir(<path>, mode=0o777)        # Creates a directory. Permissions are in octal.
-os.makedirs(<path>, mode=0o777)     # Creates all path's dirs. Also: `exist_ok=False`.
+os.makedirs(<path>, mode=0o777)     # Creates all path's dirs. Also `exist_ok=False`.
 
shutil.copy(from, to)               # Copies the file. 'to' can exist or be a dir.
 shutil.copytree(from, to)           # Copies the directory. 'to' must not exist.
@@ -2048,7 +2048,7 @@ logging.debug/info/warning/error/critical(<str>)  >>> logger.addHandler(handler)
 >>> logger.critical('Running out of disk space.')
 CRITICAL:my_module:Running out of disk space.
->>> open('test.log').read()
+>>> print(open('test.log').read())
 2023-02-07 23:21:01,430 CRITICAL:my_module:Running out of disk space.
 
@@ -2463,13 +2463,13 @@ rect = pg.Rect(240, 2

Surface

Object for representing images.

<Surf> = pg.display.set_mode((width, height))   # Opens new window and returns its surface.
 <Surf> = pg.Surface((width, height))            # New RGB surface. RGBA if `flags=pg.SRCALPHA`.
 <Surf> = pg.image.load(<path/file>)             # Loads the image. Format depends on source.
-<Surf> = pg.surfarray.make_surface(<np_array>)  # Also `<array> = surfarray.pixels3d(<Surf>)`.
+<Surf> = pg.surfarray.make_surface(<np_array>)  # Also `<np_arr> = surfarray.pixels3d(<Surf>)`.
 <Surf> = <Surf>.subsurface(<Rect>)              # Returns a subsurface.
 
<Surf>.fill(color)                              # Tuple, Color('#rrggbb[aa]') or Color(<name>).
-<Surf>.set_at((x, y), color)                    # Updates pixel.
+<Surf>.set_at((x, y), color)                    # Updates pixel. Also <Surf>.get_at((x, y)).
 <Surf>.blit(<Surf>, (x, y))                     # Draws passed surface to the surface.
 
from pygame.transform import scale, ...
@@ -2740,7 +2740,7 @@ plt.show()                                     # Disp
 
<dict> = <DF>.to_dict(['d/l/s/…'])             # Returns columns as dicts, lists or series.
 <str>  = <DF>.to_json/html/csv([<path>])       # Also to_markdown/latex([<path>]).
-<DF>.to_pickle/excel(<path>)                   # Run `$ pip3 install openpyxl` for xlsx files.
+<DF>.to_pickle/excel(<path>)                   # Run `$ pip3 install "pandas[excel]" odfpy`.
 <DF>.to_sql('<table_name>', <connection>)      # Accepts SQLite3 or SQLAlchemy connection.
 

GroupBy

Object that groups together rows of a dataframe based on the value of the passed column.

>>> df = pd.DataFrame([[1, 2, 3], [4, 5, 6], [7, 8, 6]], list('abc'), list('xyz'))
@@ -2934,7 +2934,7 @@ $ pyinstaller script.py --add-data '<path>:.'  
  
 
   
 
diff --git a/parse.js b/parse.js
index c9534ab..0be7718 100755
--- a/parse.js
+++ b/parse.js
@@ -203,7 +203,7 @@ const LOGGING_EXAMPLE =
   '>>> logger.addHandler(handler)\n' +
   '>>> logger.critical(\'Running out of disk space.\')\n' +
   'CRITICAL:my_module:Running out of disk space.\n' +
-  '>>> open(\'test.log\').read()\n' +
+  '>>> print(open(\'test.log\').read())\n' +
   '2023-02-07 23:21:01,430 CRITICAL:my_module:Running out of disk space.\n';
 
 const AUDIO =