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 | |
import datetime | |
from collections import OrderedDict | |
def create_racer_abbreviations_dict(file_name): | |
"""Retrieves {'abbreviation': (name, team)}" format dict from abbreviations.txt""" | |
abbreviations_dict = {} | |
with open(file_name, 'r') as fn: | |
for line in fn: |
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
7620cdb0:0001000010111011 | |
3e20c9b6:0101110000010000 | |
512372de:0001001101000111 | |
70056ff5:1110000000010001 | |
4fb7672d:1101011111011000 | |
5cc8cd42:0011110001111001 | |
5264cfda:0101000011100110 | |
6ae48931:0010111001010010 | |
614edbdd:0011010011001100 | |
4ef3ebbb:0110100010111011 |
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 fastkml import kml │ | |
with open('/home/stytarenko/Downloads/test.kml', 'rb') as myfile: │ | |
doc=myfile.read() │ | |
k.from_string(doc) │ | |
features = list(k.features()) │ |
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 random | |
class HealthManager: | |
def __init__(self, health, delta_health=20): | |
self.__health = health | |
self.delta_health = delta_health | |
@property | |
def health(self): | |
return self.__health |
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 random | |
class Health: | |
def __init__(self, health, delta=10): | |
self.health = health | |
self.delta = delta | |
def decrease(self, ratio): | |
self.health -= ratio * self.delta |