You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
708 B
Python
31 lines
708 B
Python
import datetime
|
|
|
|
class Exercise00:
|
|
STUDENT_NAME = "Eggert Jung"
|
|
|
|
def __init__(self, txt=""):
|
|
self.__txt = txt[:17] + "..."
|
|
|
|
@staticmethod
|
|
def deadline(formatstr):
|
|
time = datetime.datetime(2020, 11, 11, 11, 59)
|
|
return time.strftime(formatstr)
|
|
|
|
@property
|
|
def txt(self):
|
|
return self.__txt
|
|
|
|
def format(self, mode):
|
|
if mode == "order":
|
|
return "{2} - {1} - {0}"
|
|
|
|
if mode == "dict":
|
|
return "x, y = ({x:.1f}, {y:.04f})"
|
|
|
|
def listfiles(self, directory, filetype=''):
|
|
from pathlib import Path
|
|
path = Path(directory)
|
|
|
|
for file in path.glob('**/*'+filetype):
|
|
yield str(file.name)
|