版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/legend818/article/details/77323676
定义一个class MyTimer,文件名mytimer,保存在指定路径 假设:D:\studypython 目录下
如果使用python shell去调用,需要
>>> import sys;
>>> sys.path.append('D:\studypython');
>>> from mytimer import MyTimer
>>> t1 = MyTimer()
如果是直接放在python安装目录下,
>>> from mytimer import MyTimer
>>> t1 = MyTimer()