I need to store the content of a yaml file to a variable as it is(without converting to dictionary) or after storing it as dictionary is there any way to bring back to yaml format without storing it inside the file. I tried with yaml.load(file) which returns the object in dictionary. Is there any way to achieve?
What about?
ymlFile = open('file.yml').read()
https://www.pythonforbeginners.com/files/reading-and-writing-files-in-python
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.