Closed huni1023 closed 6 months ago
sample codes from other project
with open(f'{BASE_DIR}/{pdf_target}/{cleaned_grade_str}{subject_eng}.yaml', 'rb') as f:
try:
config = yaml.load(f, Loader=yaml.FullLoader)
except yaml.YAMLError as e:
print("Parsing YAML string failed")
print("Reason:", e.reason)
print("At position: {0} with encoding {1}".format(e.position, e.encoding))
print("Invalid char code:", e.character)
raise ValueError
depends on PyYaml version,
Loader
argument is required