PDM/util.py

14 lines
379 B
Python

def read_file(filepath: str) -> list[str]:
file = open(filepath, "r")
return file.readlines()
def write_file(filepath: str, insert_string: str) -> bool:
file = open(filepath, "w")
file.write(insert_string)
file.close()
def append_file(filepath: str, append_string: str) -> bool:
file = open(filepath, "a")
file.write(append_string)
file.close()