python中同一个类的函数怎么调用另一个函数里的数据

import xlrd

class Study:
def a():
filename = xlrd.open_workbook("E:/PythonWorkspace/timesheetsconfig.xlsx") #打开Excel
sheet = filename.sheets()[0] #读取第一个sheet页
FirstCol = sheet.col_values(0) #首列
SecondCol = sheet.col_values(1) #第2列
dic = {} #创建一个空字典
for key,value in zip(FirstCol,SecondCol): #用zip方法将两个list合并成一个字典
dic[key] = value #并将FirstCol作为key,SecondCol作为value
return dic

def c():

现在想实现的是:在函数c()中将函数a()中的dic打印出来,应该要怎么样写?

#a()不是return了它么
def c():
    dic=a()
    #现在打印dic吧
    #........
    #
    #.......

温馨提示:答案为网友推荐,仅供参考
第1个回答  2019-06-25
Study.a()
前面加上类的全名就行了
相似回答