bat如下:
D: cd D:\workspace\DeductCompare\TestCase python.exe Case.py
原始case.py头如下
import shutil import unittest from datetime import datetime from Logic.ComputionalLogic import ComputionalLogic
报错:找不到Logic模块
需要添加os.path,但是每运行一次需要加一次,暂未找到永久方法
import shutil import unittest import os,sys curPath = os.path.abspath(os.path.dirname(__file__)) rootPath = os.path.split(curPath)[0] sys.path.append(rootPath) from datetime import datetime from Logic.ComputionalLogic import ComputionalLogic
原文地址:https://www.cnblogs.com/carlvine/p/9797752.html
时间: 2024-11-09 02:59:49