首页 > Windows开发 > 详细

在调用self对象时,本类调用用Win32Info().collect()

时间:2019-11-19 17:37:31      阅读:79      评论:0      收藏:0      [点我收藏+]
import platform

class Test:
def test(self):
func = getattr(self,‘windows‘)
func()

@staticmethod
def windows():
from plugins.collect_windows_info import Win32Info
return Win32Info().collect() #在调用self对象时,本类调用用Win32Info().collect()
@staticmethod
def linux():
return ‘OK2‘
def test2(self):
return Test().test()




if __name__ == ‘__main__‘:
ob = Test()
op = ob.test2()

在调用self对象时,本类调用用Win32Info().collect()

原文:https://www.cnblogs.com/cheyunhua/p/11890655.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!