1import sys
2
3import yaml
4
5
6def get_first_key(file_path):
7 with open(file_path, "r") as yaml_file:
8 content = yaml.safe_load(yaml_file)
9 first_key = next(iter(content))
10 return first_key
11
12
13if __name__ == "__main__":
14 yaml_file_path = sys.argv[1]
15 print(get_first_key(yaml_file_path))
16
1import sys
2
3import yaml
4
5
6def get_first_key(file_path):
7 with open(file_path, "r") as yaml_file:
8 content = yaml.safe_load(yaml_file)
9 first_key = next(iter(content))
10 return first_key
11
12
13if __name__ == "__main__":
14 yaml_file_path = sys.argv[1]
15 print(get_first_key(yaml_file_path))
16