def run(self, output_fn, **kwargs): fd = open(output_fn, 'w') while True: BASEDIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(BASEDIR) os.environ['AUTO_CLIENT_SETTINGS'] = "conf.settings" from src import script script.start() line = time.ctime() + '\n' fd.write(line) fd.flush() time.sleep(60) fd.close()
# -*- coding: UTF-8 -*- import sys import os import time BASEDIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(BASEDIR) os.environ['AUTO_CLIENT_SETTINGS'] = "conf.settings" from src import script if __name__ == '__main__': while True: script.start() time.sleep(60)
#! /usr/bin/env python # -*- coding: utf-8 -*- # __author__ = "wyd" # Date: 2017/9/25 import sys import os BASEDIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(BASEDIR) os.environ['AUTO_CLIENT_SETTINGS'] = "conf.settings" from src import script if __name__ == "__main__": obj = script.start()