Answer the question
In order to leave comments, you need to log in
PyYaml - Can't load string from yaml, what should I do?
I want to import one prefix line from my config.yaml file but I can't because of a strange error
Console:
test.py:3: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
config = yaml.load("config.yaml")
Traceback (most recent call last):
File "test.py", line 5, in
print(config['prefix'])
TypeError: string indices must be
integers
import yaml
config = yaml.load("config.yaml")
print(config['prefix'])
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question