- https://twitter.com/ZhikangZhang
- https://twitter.com/ossronny
- https://twitter.com/the_compiler
- https://twitter.com/pypi
- https://twitter.com/WillingCarol
- https://twitter.com/ThePyPA
- https://twitter.com/malemburg
- https://twitter.com/nlhkabu
- https://twitter.com/codewithanthony
- https://twitter.com/obestwalter
This file contains 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
(venv) the_tale@local:~/current$ django-admin dext_run_tests --settings the_tale.settings | |
Creating test database for alias 'default'... | |
........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................ |
This file contains 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 logging | |
logger = logging.getLogger(__name__) | |
def setup_logger(logger, level=logging.INFO): | |
console = logging.StreamHandler(stream=sys.stdout) | |
logger.addHandler(console) | |
ch = logging.Formatter('[%(levelname)s] %(asctime)s - %(message)s') | |
console.setFormatter(ch) |
This file contains 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 csv | |
with open(csv_filename) as csv_fd: | |
reader = csv.reader(csv_fd, delimiter=';') | |
next(reader) # пропускаем заголовок | |
for row in reader: | |
print(row) |
This file contains 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
# Add the remote, call it "upstream": | |
git remote add upstream https://github.com/whoever/whatever.git | |
# Fetch all the branches of that remote into remote-tracking branches, | |
# such as upstream/master: | |
git fetch upstream | |
# Make sure that you're on your master branch: |
This file contains 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
# Найти все действительные числа, например: -100; 21.4; +5.3; -1.5; 0 | |
res = re.findall(r"[-+]?\d+(?:\.\d+)?", test_str) | |
# Проверить, что строка это серийный номер вида 00XXX-XXXXX-XXXXX-XXXXX, где X - шестнадцатиричная цифра | |
if re.match(r"^00[\da-f]{3}(?:-[\da-f]{5}){3}$", serial_str, re.IGNORECASE): | |
# Проверить, что строка является корректным IPv4 адресом | |
if re.match(r"^((25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(\.|$)){4}(?<!\.)$", ip_str): |
This file contains 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
https://scabere.livejournal.com/62886.html |
This file contains 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
1. Install Fedora | |
2. Install W10 | |
3. grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg |
In [7]: x = 'test'
In [8]: id(x)
Out[8]: 140360214912952
In [9]: y = x.encode().decode()
In [10]: y
Out[10]: 'test'