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

 

相关文章:

  • 2021-09-23
  • 2021-11-16
  • 2021-07-22
  • 2021-09-24
  • 2022-12-23
  • 2021-11-03
  • 2021-07-20
  • 2021-12-13
猜你喜欢
  • 2021-11-06
  • 2022-12-23
  • 2021-12-01
  • 2022-01-20
  • 2021-12-13
  • 2021-12-27
相关资源
相似解决方案