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 os | |
LESSONS = 14 | |
SW = [7, 12] | |
TW = [] | |
LESSON_TYPES = ['AW', 'HW', 'CW', 'Test'] | |
sw_count = 0 | |
tw_count = 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 os | |
import shutil | |
files = sorted(filter(lambda x: os.path.isfile(x) and x.endswith('.py'), os.listdir())) | |
var = {'a': 'AW', 't': 'Test', 's': 'SW', 'test': 'TW', 'h': 'HW', 'c': 'CW'} | |
moved_files = [] | |
for i in files: | |
try: | |
file = i.rstrip(').py').split('(')[1].lower() |
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
class Vector: | |
def __init__(self, x, y): | |
self.x, self.y = x, y | |
def __mul__(self, other): | |
if type(other) is not Vector: | |
return Vector(self.x * other, self.y * other) | |
else: | |
return Vector(self.x * other.x, self.y * other.y) | |
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
sockets = int(input()) # in range(1, 1016) | |
appliances = int(input()) # in range(1, 1016) | |
to2 = int(input()) # in range(1, 1001) | |
to5 = int(input()) # in range(1, 1001) | |
def rec_max(socket, numb=0): | |
return numb if numb*socket >= appliances else rec_max(socket, numb+1) | |
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
sockets = int(input()) # in range(1, 1016) | |
appliances = int(input()) # in range(1, 1016) | |
to2 = int(input()) # in range(1, 1001) | |
to5 = int(input()) # in range(1, 1001) | |
def rec_max(socket, numb=0): | |
if numb * socket >= appliances: | |
return numb | |
return rec_max(socket, numb+1) |
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
# /usr/bin/python3.6 | |
import os, time | |
while True: | |
for i in list("▀▐▄▌"): | |
os.system("clear") | |
print(i) | |
time.sleep(0.3) |
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 sys import stdout | |
from time import sleep | |
for i in range(1, 101): | |
stdout.write("\r%d%%" % i) | |
sleep(.2) | |
stdout.write("\r\r") |
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
{ | |
"date": { | |
"day": 4, | |
"month": 1, | |
"year": 2018 | |
}, | |
"course": [ | |
{ | |
"id": "R01010", | |
"num_code": 36, |
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 os | |
from time import asctime, time | |
file_log = os.getcwd()+'/.log' | |
with open(file_log, 'w', encoding='utf-8') as file: | |
file.write(asctime()+'\n') | |
HOME = os.getcwd() | |
ROOT = os.path.abspath(os.getcwd()).split('/')[0]+'/' | |
os.chdir(ROOT) |
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
def full_copy(l): | |
return [full_copy(i) if type(i) is list else i for i in list(l)] | |
if __name__ == '__main__': | |
t1 = [1, [2], [[3]]] | |
t2 = full_copy(t1) | |
t2[1].append(0) | |
t1[2][0].append(5) | |
print(t1, t2, sep='\n') |
OlderNewer