Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bbde7a7

Browse files
committed
Format, Pygame
1 parent fd77305 commit bbde7a7

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,18 +412,20 @@ Format
412412
{<el>:.<10} # '<el>......'
413413
{<el>:0} # '<el>'
414414
```
415-
* **Use `'{<el>:{<str/int/float>}[...]}'` to set options dynamically.**
415+
* **Options can be generated dynamically: `f'{<el>:{<str/int>}[]}'`.**
416416
* **Adding `'!r'` before the colon converts object to string by calling its [repr()](#class) method.**
417417

418418
### Strings
419419
```python
420-
{'abcde'!r:10} # "'abcde' "
420+
{'abcde':10} # 'abcde '
421421
{'abcde':10.3} # 'abc '
422422
{'abcde':.3} # 'abc'
423+
{'abcde'!r:10} # "'abcde' "
423424
```
424425

425426
### Numbers
426427
```python
428+
{ 123456:10} # ' 123456'
427429
{ 123456:10,} # ' 123,456'
428430
{ 123456:10_} # ' 123_456'
429431
{ 123456:+10} # ' +123456'
@@ -2950,7 +2952,7 @@ while all(event.type != pg.QUIT for event in pg.event.get()):
29502952
**Object for representing images.**
29512953
```python
29522954
<Surf> = pg.display.set_mode((width, height)) # Returns display surface.
2953-
<Surf> = pg.Surface((width, height), …) # New RGB surface. Add `pg.SRCALPHA` for RGBA.
2955+
<Surf> = pg.Surface((width, height) [, flags]) # New RGB surface. RGBA if `flags=pg.SRCALPHA`.
29542956
<Surf> = pg.image.load('<path>') # Loads the image. Format depends on source.
29552957
<Surf> = <Surf>.subsurface(<Rect>) # Returns a subsurface.
29562958
```

index.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@
226226

227227
<body>
228228
<header>
229-
<aside>October 2, 2021</aside>
229+
<aside>October 4, 2021</aside>
230230
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
231231
</header>
232232

@@ -537,15 +537,17 @@
537537
</code></pre></div>
538538

539539
<ul>
540-
<li><strong>Use <code class="python hljs"><span class="hljs-string">'{&lt;el&gt;:{&lt;str/int/float&gt;}[...]}'</span></code> to set options dynamically.</strong></li>
540+
<li><strong>Options can be generated dynamically: <code class="python hljs"><span class="hljs-string">f'<span class="hljs-subst">{&lt;el&gt;:{&lt;str/int&gt;}</span>[…]}'</span></code>.</strong></li>
541541
<li><strong>Adding <code class="python hljs"><span class="hljs-string">'!r'</span></code> before the colon converts object to string by calling its <a href="#class">repr()</a> method.</strong></li>
542542
</ul>
543-
<div><h3 id="strings">Strings</h3><pre><code class="python language-python hljs">{<span class="hljs-string">'abcde'</span>!r:<span class="hljs-number">10</span>} <span class="hljs-comment"># "'abcde' "</span>
543+
<div><h3 id="strings">Strings</h3><pre><code class="python language-python hljs">{<span class="hljs-string">'abcde'</span>:<span class="hljs-number">10</span>} <span class="hljs-comment"># 'abcde '</span>
544544
{<span class="hljs-string">'abcde'</span>:<span class="hljs-number">10.3</span>} <span class="hljs-comment"># 'abc '</span>
545545
{<span class="hljs-string">'abcde'</span>:<span class="hljs-number">.3</span>} <span class="hljs-comment"># 'abc'</span>
546+
{<span class="hljs-string">'abcde'</span>!r:<span class="hljs-number">10</span>} <span class="hljs-comment"># "'abcde' "</span>
546547
</code></pre></div>
547548

548-
<div><h3 id="numbers-1">Numbers</h3><pre><code class="python language-python hljs">{ <span class="hljs-number">123456</span>:<span class="hljs-number">10</span>,} <span class="hljs-comment"># ' 123,456'</span>
549+
<div><h3 id="numbers-1">Numbers</h3><pre><code class="python language-python hljs">{ <span class="hljs-number">123456</span>:<span class="hljs-number">10</span>} <span class="hljs-comment"># ' 123456'</span>
550+
{ <span class="hljs-number">123456</span>:<span class="hljs-number">10</span>,} <span class="hljs-comment"># ' 123,456'</span>
549551
{ <span class="hljs-number">123456</span>:<span class="hljs-number">10</span>_} <span class="hljs-comment"># ' 123_456'</span>
550552
{ <span class="hljs-number">123456</span>:+<span class="hljs-number">10</span>} <span class="hljs-comment"># ' +123456'</span>
551553
{<span class="hljs-number">-123456</span>:=<span class="hljs-number">10</span>} <span class="hljs-comment"># '- 123456'</span>
@@ -2538,7 +2540,7 @@
25382540
&lt;list&gt; = &lt;Rect&gt;.collidelistall(&lt;list_of_Rect&gt;) <span class="hljs-comment"># Returns indexes of all colliding Rects.</span>
25392541
</code></pre>
25402542
<div><h3 id="surface">Surface</h3><p><strong>Object for representing images.</strong></p><pre><code class="python language-python hljs">&lt;Surf&gt; = pg.display.set_mode((width, height)) <span class="hljs-comment"># Returns display surface.</span>
2541-
&lt;Surf&gt; = pg.Surface((width, height), …) <span class="hljs-comment"># New RGB surface. Add `pg.SRCALPHA` for RGBA.</span>
2543+
&lt;Surf&gt; = pg.Surface((width, height) [, flags]) <span class="hljs-comment"># New RGB surface. RGBA if `flags=pg.SRCALPHA`.</span>
25422544
&lt;Surf&gt; = pg.image.load(<span class="hljs-string">'&lt;path&gt;'</span>) <span class="hljs-comment"># Loads the image. Format depends on source.</span>
25432545
&lt;Surf&gt; = &lt;Surf&gt;.subsurface(&lt;Rect&gt;) <span class="hljs-comment"># Returns a subsurface.</span>
25442546
</code></pre></div>
@@ -3005,7 +3007,7 @@
30053007

30063008

30073009
<footer>
3008-
<aside>October 2, 2021</aside>
3010+
<aside>October 4, 2021</aside>
30093011
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
30103012
</footer>
30113013

0 commit comments

Comments
 (0)