* **`'encoding=None'` means that the default encoding is used, which is platform dependent. Best practice is to use `'encoding="utf-8"'` whenever possible.**
* **`'newline=None'` means all different end of line combinations are converted to '\n' on read, while on write all '\n' characters are converted to system's default line separator.**
@ -1841,7 +1841,7 @@ SQLite
**Opens a connection to the database file. Creates a new file if path doesn't exist.**
```python
import sqlite3
<con> = sqlite3.connect('<path>') # Also ':memory:'.
<con> = sqlite3.connect(<path>) # Also ':memory:'.
<con>.close() # Closes the connection.
```
@ -2347,7 +2347,7 @@ from matplotlib import pyplot
pyplot.plot(<y_data> [, label=<str>])
pyplot.plot(<x_data>, <y_data>)
pyplot.legend() # Adds a legend.
pyplot.savefig('<path>') # Saves the figure.
pyplot.savefig(<path>) # Saves the figure.
pyplot.show() # Displays the figure.
pyplot.clf() # Clears the figure.
```
@ -2697,9 +2697,9 @@ from PIL import Image
```python
<Image> = Image.new('<mode>', (width, height))
<Image> = Image.open('<path>')
<Image> = Image.open(<path>)
<Image> = <Image>.convert('<mode>')
<Image>.save('<path>')
<Image>.save(<path>)
<Image>.show()
```
@ -2961,9 +2961,9 @@ while all(event.type != pg.QUIT for event in pg.event.get()):
<div><h2id="sqlite"><ahref="#sqlite"name="sqlite">#</a>SQLite</h2><p><strong>Server-less database engine that stores each database into a separate file.</strong></p><div><h3id="connect">Connect</h3><p><strong>Opens a connection to the database file. Creates a new file if path doesn't exist.</strong></p><pre><codeclass="python language-python hljs"><spanclass="hljs-keyword">import</span> sqlite3
<con> = sqlite3.connect(<spanclass="hljs-string">'<path>'</span>)<spanclass="hljs-comment"># Also ':memory:'.</span>
<con> = sqlite3.connect(<path>) <spanclass="hljs-comment"># Also ':memory:'.</span>
<con>.close() <spanclass="hljs-comment"># Closes the connection.</span>
</code></pre></div></div>
@ -2049,7 +2049,7 @@ curses.wrapper(main)
pyplot.plot(<y_data> [, label=<str>])
pyplot.plot(<x_data>, <y_data>)
pyplot.legend() <spanclass="hljs-comment"># Adds a legend.</span>
pyplot.savefig(<spanclass="hljs-string">'<path>'</span>)<spanclass="hljs-comment"># Saves the figure.</span>
pyplot.savefig(<path>) <spanclass="hljs-comment"># Saves the figure.</span>
pyplot.show() <spanclass="hljs-comment"># Displays the figure.</span>
pyplot.clf() <spanclass="hljs-comment"># Clears the figure.</span>
</code></pre></div>
@ -2318,9 +2318,9 @@ right = [[<span class="hljs-number">0.1</span>, <span class="hljs-number">0.6</s
<Surf> = <Font>.render(text, antialias, color [, background])
<div><h3id="font">Font</h3><pre><codeclass="python language-python hljs"><Font> = pg.font.SysFont(<spanclass="hljs-string">'<name>'</span>, size) <spanclass="hljs-comment"># Loads the system font or default if missing.</span>
<Font> = pg.font.Font(<spanclass="hljs-string">'<path>'</span>, size)<spanclass="hljs-comment"># Loads the TTF file. Pass None for default.</span>
<Surf> = <Font>.render(text, antialias, color) <spanclass="hljs-comment"># Background color can be specified at the end.</span>
</code></pre></div>
<div><h3id="sound">Sound</h3><pre><codeclass="python language-python hljs"><Sound> = pg.mixer.Sound(<spanclass="hljs-string">'<path>'</span>) <spanclass="hljs-comment"># Loads the WAV file.</span>