-
.
- любой символ -
a
- символ буквы "a" (тоже и с другими буквами) -
\n
- символ переноса строки -
\t
- символ табуляции -
\d
- все числа, тоже что и [0-9]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
TURN_TIME = 3 | |
TRAFFIC_LIGHTS = ( | |
'🔴', | |
'🟡', | |
'🟢', | |
) | |
USER_ACTIONS = ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
# Стоит заметить, что библиотека re не поддерживает некоторые расширенные возможности регулярных выражений для Юникода. | |
# Например, для использования удобнейших групп символов, наподобии \p{Cyrillic} используйте библиотеку regex | |
# О библиотеке: https://pypi.org/project/regex/ | |
# Подробнее о дополнительном функционале: https://www.regular-expressions.info/unicode.html#prop | |
# Можно использовать match() или search() для поиска совпадений, их отличие не принципиально для случаев ниже: | |
# search ⇒ найти что-нибудь в строке и вернуть соответствующий объект. | |
# match ⇒ найти что-то в начале строки и вернуть соответствующий объект. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
# одномерный массив | |
x = np.array([1, 4, 5, 8], float) | |
print(x, '||', type(x)) | |
# матрица | |
a = np.array([[1, 2, 3], [4, 5, 6]], float) | |
print(a) | |
print('Первый элемент {}, первая строка {}, первый столбик {}'.format(a[0, 0], a[0, :], a[:, 0])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pickle | |
# write pickle | |
file_write = open('pin.dat', 'wb') | |
a = list(range(1000)) | |
pickle.dump(a, file_write) | |
file_write.close() | |
# read pickle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
background-color: rgba(0, 0, 0, 0); | |
margin: 0px auto; | |
overflow: hidden; | |
} | |
yt-live-chat-renderer { | |
background-color: rgba(0, 0, 0, 0.6) !important; | |
} | |
A quick way to sketch out musical chord progressions.
uses my Scale Generator and Arpeggio Pattern Generator and the lovely Tone.js.
I've started collecting my musical composition stuff in this collection.
A Pen by Jake Albaugh on CodePen.