├── .gitignore ├── basic-functions ├── basic-functions-cs.pdf ├── basic-functions-cs.svg ├── basic-functions-en.pdf └── basic-functions-en.svg ├── basic-git ├── basic-git-cs.pdf └── basic-git-cs.svg ├── big-git ├── big-git-cs.pdf └── big-git-cs.svg ├── classes ├── classes.pdf └── classes.svg ├── combine-a4.sh ├── dicts ├── dicts-cs.pdf └── dicts-cs.svg ├── errors ├── errors-cs.pdf ├── errors-cs.svg ├── errors-en.pdf └── errors-en.svg ├── exceptions ├── exceptions-cs.pdf └── exceptions-cs.svg ├── export-all.py ├── game-physics ├── game-physics-cs.pdf ├── game-physics-cs.svg ├── game-physics-en.pdf └── game-physics-en.svg ├── keyboard ├── keyboard-cs.pdf ├── keyboard-cs.svg ├── keyboard-sk.pdf └── keyboard-sk.svg ├── lists ├── lists-cs.pdf └── lists-cs.svg ├── micropython ├── nodemcu-cs.pdf ├── nodemcu-cs.svg ├── nodemcu-en.pdf ├── nodemcu-en.svg ├── nodemcuv1-cs.pdf └── nodemcuv1-cs.svg ├── numpy ├── numpy-cs.pdf └── numpy-cs.svg ├── pathlib ├── pathlib-cs.pdf └── pathlib-cs.svg ├── pyglet ├── pyglet-basics-cs.pdf ├── pyglet-basics-cs.svg ├── pyglet-basics-en.pdf └── pyglet-basics-en.svg ├── sets ├── sets-cs.pdf ├── sets-cs.svg ├── sets-en.pdf └── sets-en.svg └── strings ├── strings-cs.pdf ├── strings-cs.svg ├── strings-en.pdf └── strings-en.svg /.gitignore: -------------------------------------------------------------------------------- 1 | /combined-a4.pdf 2 | -------------------------------------------------------------------------------- /basic-functions/basic-functions-cs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyvec/cheatsheets/d257f1caefbc2e3869760ba8063eae8abd519d09/basic-functions/basic-functions-cs.pdf -------------------------------------------------------------------------------- /basic-functions/basic-functions-cs.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 29 | 34 | 35 | 43 | 48 | 49 | 57 | 62 | 63 | 71 | 76 | 77 | 85 | 90 | 91 | 99 | 104 | 105 | 113 | 118 | 119 | 127 | 132 | 133 | 139 | W 151 | 152 | 153 | 180 | 187 | 188 | 190 | 191 | 193 | image/svg+xml 194 | 196 | 197 | 198 | 199 | 200 | 205 | 215 | 216 | 221 | 225 | Užitečné funkce 247 | Vstup a výstup 258 | print(1, 'dva'),print(1, 'dva', end='')print(1, 'dva', sep=', ')input('Kolik? ') 285 | vypíše dané hodnoty, oddělené mezerou, na řádekvypíše dané hodnoty, ale nepřejde na nový řádekhodnoty oddělí čárkouzeptá se na uživatele; odpověď vrátí jako řetězec 311 | Převádění typů 322 | str(123)int('123')int(123.4)float('123.4')bool(1) 353 | převede jakoukoli hodnotu na řetězecpřevádí na celé číslo (může způsobit ValueError)—z desetinných čísel „odstřihne“ necelou částpřevádí na reálné číslo (může způsobit ValueError)boolean (prázdný řetězec a 0: False, jiné řetězce/čísla: True) 388 | Matematika 399 | from math import sin, cos, tan, sqrt, piround(x)floor(x)ceil(x)sqrt(x)abs(x) 442 | zaokrouhlenízaokrouhlení dolůzaokrouhlení nahorudruhá odmocninaabsolutní hodnota 477 | sin(u)cos(u)tan(u)degrees(r)radians(d) 516 | goniometrické funkce(vstup v radiánech) 531 | Náhoda 542 | from random import randrange, uniformrandrange(0, 10)uniform(0, 10) 565 | náhodné celé číslo od 0 do 9náhodné reálné číslo 0 ≤ x < 10 580 | Informace o programu 591 | help(x)dir()dir(x)type(x) 614 | nápověda k objektu xpřehled jmen proměnnýchpřehled atributů (např. metod) objektu xtyp objektu x 637 | a další – https://docs.python.org/3/library/functions.html, turtle.html, math.html 648 | © 2015 Petr Viktorin. Ke stažení na https://github.com/encukou/cheatsheets. Šířeno pod licencí CC BY-SA: http://creativecommons.org/licenses/by-sa/4.0/ 659 | 663 | 669 | 675 | 678 | 688 | 691 | 695 | 696 | 697 | 701 | 704 | 709 | 714 | 715 | 718 | 723 | 728 | 729 | 732 | 742 | 745 | 749 | 753 | 754 | 755 | 757 | 763 | 765 | 769 | 774 | 775 | 780 | 781 | 782 | 783 | Přehled prvních funkcí v jazyce Python. 794 | Želva 805 | from turtle import forward, left, right, shape, penup, pendownforward(n)left(u)right(u)shape(s)penup()pendown()exitonclick() 848 | popojet dopředu o n pixelůotočit doleva o u stupňůotočit doprava o u stupňůnastavit tvar ("arrow", "turtle", "circle", "square", …)přestat kreslitzačít kreslitpočkat na kliknutí 883 | radiány na stupněstupně na radiány 898 | 899 | 900 | -------------------------------------------------------------------------------- /basic-functions/basic-functions-en.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyvec/cheatsheets/d257f1caefbc2e3869760ba8063eae8abd519d09/basic-functions/basic-functions-en.pdf -------------------------------------------------------------------------------- /basic-functions/basic-functions-en.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 29 | 34 | 35 | 43 | 48 | 49 | 57 | 62 | 63 | 71 | 76 | 77 | 85 | 90 | 91 | 99 | 104 | 105 | 113 | 118 | 119 | 127 | 132 | 133 | 139 | W 151 | 152 | 153 | 180 | 187 | 188 | 190 | 191 | 193 | image/svg+xml 194 | 196 | 197 | 198 | 199 | 200 | 205 | 215 | 216 | 221 | 225 |   Useful built-in functions 248 | Input and Output 259 | print(1, 'two'),print(1, 'two', end='')print(1, 'two', sep=', ')input('How much? ')  290 | List the values, separated by a space, on a lineList the values, but doesn’t move to a new lineList the values, separated by commaAsks the user for input; returns the input as a string 321 | Type casting 332 | str(123)int('123')int(123.4)float('123.4')bool(1)  368 | Converts any value to a stringConverts to integer (may generate ValueError)Removing the decimal partConverts to a real number (may generate ValueError)Boolean (empty string or 0: False; other strings/numbers: True)) 404 | Maths 415 | from math import sin, cos, tan, sqrt, pi round(x)floor(x)ceil(x) sqrt(x)abs(x)  466 | roundingrounding downrounding up square rootabsolute value  507 | sin(u)cos(u)tan(u) degrees(r)radians(d)   553 | trigonometric functions (input in radians) 569 | Random 580 | from random import randrange, uniform randrange(0, 10)uniform(0, 10) 606 | Random integer between 0 and 9Random real number: 0 <= x <= 10 622 | Program information 633 | help(x)dir()dir(x)type(x) 659 | Get help on specific object xOverview of variable namesOverview of attributes (e.g. methods) of object xGet type of object x 685 | and more – https://docs.python.org/3/library/functions.html, turtle.html, math.html 696 | © 2015 Petr Viktorin. Czech original https://github.com/encukou/cheatsheets. LicenseCC BY-SA: http://creativecommons.org/licenses/by-sa/4.0/ 707 | 711 | 717 | 723 | 726 | 736 | 739 | 743 | 744 | 745 | 749 | 752 | 757 | 762 | 763 | 766 | 771 | 776 | 777 | 780 | 790 | 793 | 797 | 801 | 802 | 803 | 805 | 811 | 813 | 817 | 822 | 823 | 828 | 829 | 830 | 831 | Useful Python built-in functions. 842 | Turtle 853 | from turtle import forward, left, right, shape, penup, pendown forward(n)left(u)right(u)shape(s)penup()pendown()exitonclick() 904 | move forward by n pixelsturn left by u degreesturn right by u degreesset the shape ("arrow", "turtle", "circle", "square", …)stop drawingstart drawingwait for mouse click 945 | radians to degreesdegrees to radians 961 | 962 | 963 | -------------------------------------------------------------------------------- /basic-git/basic-git-cs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyvec/cheatsheets/d257f1caefbc2e3869760ba8063eae8abd519d09/basic-git/basic-git-cs.pdf -------------------------------------------------------------------------------- /big-git/big-git-cs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyvec/cheatsheets/d257f1caefbc2e3869760ba8063eae8abd519d09/big-git/big-git-cs.pdf -------------------------------------------------------------------------------- /classes/classes.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyvec/cheatsheets/d257f1caefbc2e3869760ba8063eae8abd519d09/classes/classes.pdf -------------------------------------------------------------------------------- /combine-a4.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash -ex 2 | 3 | # Combine two A5 PDFs into one A4 4 | 5 | if [ "$1" == "" ]; then 6 | echo Usage: $0 filename 7 | 8 | echo Example: $0 basic-functions/basic-functions-cs.pdf 9 | else 10 | pdfjam --landscape --paper a4paper --nup 2x1 "$1" 1,1 -o combined-a4.pdf 11 | fi 12 | -------------------------------------------------------------------------------- /dicts/dicts-cs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyvec/cheatsheets/d257f1caefbc2e3869760ba8063eae8abd519d09/dicts/dicts-cs.pdf -------------------------------------------------------------------------------- /errors/errors-cs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyvec/cheatsheets/d257f1caefbc2e3869760ba8063eae8abd519d09/errors/errors-cs.pdf -------------------------------------------------------------------------------- /errors/errors-en.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyvec/cheatsheets/d257f1caefbc2e3869760ba8063eae8abd519d09/errors/errors-en.pdf -------------------------------------------------------------------------------- /exceptions/exceptions-cs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyvec/cheatsheets/d257f1caefbc2e3869760ba8063eae8abd519d09/exceptions/exceptions-cs.pdf -------------------------------------------------------------------------------- /export-all.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python3 2 | 3 | import glob 4 | import re 5 | import subprocess 6 | import shlex 7 | 8 | lines = [] 9 | for filename in glob.glob('*/*.svg'): 10 | output = re.sub(r'\.svg$', '.pdf', filename) 11 | lines.append([filename, '-A', output]) 12 | 13 | proc = subprocess.Popen(['inkscape', '--shell'], stdin=subprocess.PIPE) 14 | stdin_text = '\n'.join(' '.join(shlex.quote(w) for w in s) for s in lines) + '\n' 15 | print(stdin_text) 16 | proc.communicate(stdin_text.encode('utf-8')) 17 | print() 18 | -------------------------------------------------------------------------------- /game-physics/game-physics-cs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyvec/cheatsheets/d257f1caefbc2e3869760ba8063eae8abd519d09/game-physics/game-physics-cs.pdf -------------------------------------------------------------------------------- /game-physics/game-physics-en.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyvec/cheatsheets/d257f1caefbc2e3869760ba8063eae8abd519d09/game-physics/game-physics-en.pdf -------------------------------------------------------------------------------- /keyboard/keyboard-cs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyvec/cheatsheets/d257f1caefbc2e3869760ba8063eae8abd519d09/keyboard/keyboard-cs.pdf -------------------------------------------------------------------------------- /keyboard/keyboard-sk.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyvec/cheatsheets/d257f1caefbc2e3869760ba8063eae8abd519d09/keyboard/keyboard-sk.pdf -------------------------------------------------------------------------------- /lists/lists-cs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyvec/cheatsheets/d257f1caefbc2e3869760ba8063eae8abd519d09/lists/lists-cs.pdf -------------------------------------------------------------------------------- /micropython/nodemcu-cs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyvec/cheatsheets/d257f1caefbc2e3869760ba8063eae8abd519d09/micropython/nodemcu-cs.pdf -------------------------------------------------------------------------------- /micropython/nodemcu-en.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyvec/cheatsheets/d257f1caefbc2e3869760ba8063eae8abd519d09/micropython/nodemcu-en.pdf -------------------------------------------------------------------------------- /micropython/nodemcuv1-cs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyvec/cheatsheets/d257f1caefbc2e3869760ba8063eae8abd519d09/micropython/nodemcuv1-cs.pdf -------------------------------------------------------------------------------- /numpy/numpy-cs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyvec/cheatsheets/d257f1caefbc2e3869760ba8063eae8abd519d09/numpy/numpy-cs.pdf -------------------------------------------------------------------------------- /pathlib/pathlib-cs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyvec/cheatsheets/d257f1caefbc2e3869760ba8063eae8abd519d09/pathlib/pathlib-cs.pdf -------------------------------------------------------------------------------- /pyglet/pyglet-basics-cs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyvec/cheatsheets/d257f1caefbc2e3869760ba8063eae8abd519d09/pyglet/pyglet-basics-cs.pdf -------------------------------------------------------------------------------- /pyglet/pyglet-basics-en.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyvec/cheatsheets/d257f1caefbc2e3869760ba8063eae8abd519d09/pyglet/pyglet-basics-en.pdf -------------------------------------------------------------------------------- /pyglet/pyglet-basics-en.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 29 | 34 | 35 | 43 | 48 | 49 | 57 | 63 | 64 | 72 | 78 | 79 | 87 | 93 | 94 | 102 | 108 | 109 | 117 | 123 | 124 | 132 | 138 | 139 | 147 | 153 | 154 | 162 | 168 | 169 | 177 | 183 | 184 | 192 | 198 | 199 | 207 | 213 | 214 | 222 | 228 | 229 | 237 | 243 | 244 | 250 | W 262 | 263 | 264 | 296 | 303 | 304 | 306 | 307 | 309 | image/svg+xml 310 | 312 | 313 | 314 | 315 | 316 | 321 | 325 |   Pyglet 348 | Installation (from command line) 359 | (venv)$ python -m pip install pyglet 370 | © 2016 Petr Viktorin. Original Czech version https://github.com/pyvec/cheatsheets. License: CC BY-SA: http://creativecommons.org/licenses/by-sa/4.0/ 381 | 386 | 393 | 399 | 403 | 413 | 417 | 422 | 423 | 424 | 429 | 433 | 438 | 443 | 444 | 448 | 453 | 458 | 459 | 463 | 473 | 477 | 482 | 487 | 488 | 489 | 492 | 498 | 501 | 506 | 512 | 513 | 518 | 519 | 520 | 521 | Pyglet 532 | Render windowKey press (sym – from pyglet.window.key)Key release (modMOD_* from pyglet.window.key)Text inputCursor move (mMOTION_*from pyglet.window.key)Mouse pressed (b–button, pyglet.window.mouse)Mouse button releasedMouse motion (dx, dy – distances)Mouse scroll (x,y – where, sx,sy – how much)Mouse entered some areaMouse left some areaShow windowHide windowTries to close window (return True prevent closure) 626 | window.push_handlers( on_draw=draw_window, on_text=process_text,) 652 | More info: https://pyglet.readthedocs.io/en/latest/ 663 |   674 |   685 |   696 |   707 |   Window and loop of events 729 | import pygletwindow = pyglet.window.Window()pyglet.app.run() 750 | Register functions to events 761 | Interesting events 772 | on_draw()on_key_press(sym, mod)on_key_release(sym, mod)on_text(text)on_text_motion(m)on_mouse_press(x, y, b, mod)on_mouse_release(x, y, b, mod)on_mouse_motion(x, y, dx, dy)on_mouse_scroll(x, y, sx, sy)on_mouse_enter(x, y)on_mouse_leave(x, y)on_show()on_hide()on_close()  853 | Pictures 864 | 871 | 878 | 885 | picture = pyglet.image.load('name.png')sprite = pyglet.sprite.Sprite(picture) sprite.draw()sprite.xsprite.ysprite.rotationsprite.scalesprite.imagesprite.color  946 | Rendering (within on_draw window!)X coordinationY coordinationRotation (in degrees)Enlargement (default 1)ImageColour (blend) – 3 numbers, each from 0 (dark) to 255 (saturated) 987 | Time 998 | pyglet.clock.schedule_interval(my_ticking_function, 1/30) pyglet.clock.schedule_once(my_onetime_function, 1/2) 1019 | Calls function every 1/30 of a second (0.033 second) Calls function once after half a second  1045 | Function that was called will get one argument– time from last call or registration. 1056 | 1057 | 1058 | -------------------------------------------------------------------------------- /sets/sets-cs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyvec/cheatsheets/d257f1caefbc2e3869760ba8063eae8abd519d09/sets/sets-cs.pdf -------------------------------------------------------------------------------- /sets/sets-en.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyvec/cheatsheets/d257f1caefbc2e3869760ba8063eae8abd519d09/sets/sets-en.pdf -------------------------------------------------------------------------------- /strings/strings-cs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyvec/cheatsheets/d257f1caefbc2e3869760ba8063eae8abd519d09/strings/strings-cs.pdf -------------------------------------------------------------------------------- /strings/strings-en.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pyvec/cheatsheets/d257f1caefbc2e3869760ba8063eae8abd519d09/strings/strings-en.pdf --------------------------------------------------------------------------------