定义一个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()