17 lines
568 B
Python
17 lines
568 B
Python
import datetime
|
|
import os
|
|
|
|
def get_mod_time(path: str, format: str="%a %b %e %H:%M:%S %Z %Y") -> str:
|
|
modify_time = os.path.getmtime(path)
|
|
modify_datetime = datetime.datetime.fromtimestamp(modify_time)
|
|
return modify_datetime.strftime(format)
|
|
|
|
|
|
def get_create_time(path: str, format: str="%a %b %e %H:%M:%S %Z %Y") -> str:
|
|
create_time = os.path.getctime(path)
|
|
create_datetime = datetime.datetime.fromtimestamp(create_time)
|
|
return create_datetime.strftime(format)
|
|
|
|
|
|
def get_banlist() -> list:
|
|
return list(set(open("banlist.lol").readlines())) |