对python模块中多个类的用法详解
如下所示: import wuhan.wuhan11 class Han: def __init__(self, config): self.batch_size = config.batch_size self.num_steps = config.num_steps class config: batch_size = 10 num_steps = 50 if __name__ == '__main__': han = Han(config) print(han.batch_size) print(han.num_steps) 输出结果: /home/ubuntu/
用户评论