Python中JSON对象的纯值

Python中JSON对象的纯值,python,json,Python,Json,我坐下来尝试一些Python编程,我需要从JSON对象中获取数据。这可以通过get_data方法完成,但是我也可以得到名称,我只需要值,我该怎么做 代码如下所示 导入json 从omdbapi.movie\u搜索导入GetMovie movie=GetMovie(title='Interstellar',api_key='xxxxxx',plot='full') Title=movie.get_数据('Title')) 年=电影。获取_数据(“年”) 印刷品(标题) 打印(年份)制作底部零件:

我坐下来尝试一些Python编程,我需要从JSON对象中获取数据。这可以通过get_data方法完成,但是我也可以得到名称,我只需要值,我该怎么做

代码如下所示

导入json
从omdbapi.movie\u搜索导入GetMovie
movie=GetMovie(title='Interstellar',api_key='xxxxxx',plot='full')
Title=movie.get_数据('Title'))
年=电影。获取_数据(“年”)
印刷品(标题)
打印(年份)
制作底部零件:

...
Title = movie.get_data('Title')['Title']
Year = movie.get_data('Year')['Year']
print(Title)
print(Year)
它将输出:

Interstellar
2014

似乎您在变量
Title
中获得了字典,所以您可以执行
Title['Title']
。你可以检查它是否真的是字典
print(type(Title))
非常感谢,我对Python和这个论坛都是全新的,所以在这里这样一个地方询问是很美味的