[英]batch to run multiple linked python scripts sequentially, and no NumPy module found, also cannot use another file results
I have multiple python scripts, py1 results used to calculate py2 results, py2 results used to calculate py3 results...我有多个python脚本,py1结果用来计算py2结果,py2结果用来计算py3结果...
trying to use bat to run these files py1 first and py2 second....... It always shows NumPy not found, also cannot use the results of another script.尝试使用 bat 首先运行这些文件 py1,然后再运行 py2.......它总是显示 NumPy 未找到,也无法使用另一个脚本的结果。 Anyone can help, really appreciated.任何人都可以提供帮助,真的很感激。 Thanks谢谢
Code: My python scripts example:代码:我的 python 脚本示例:
py1: d = int(7) def task(): return int(d) d1 = task() py1: d = int(7) def task(): return int(d) d1 = task()
py2: from py1 import d1 py2: 从 py1 导入 d1
def task_1():
h =5
g2 =h+d1
return g2
g2 = test_1()
py3: from py2 import g2 py3: 从 py2 导入 g2
My Bat file code like this:我的Bat文件代码是这样的:
@echo off
"C:\Users\name\Anaconda3\python.exe" "C:\Users\name\Desktop\test_auto\py1.py" & "C:\Users\name\Desktop\test_auto\py2.py" & "C:\Users\name\Desktop\test_auto\py3.py" & pause
Make sure you have had imported NumPy in all your python files.确保您已在所有 python 文件中导入 NumPy。 Also here's a link to import the variables from other python file: Import Variable from Python FilePath这里还有一个从其他 python 文件导入变量的链接:从 Python FilePath 导入变量
Hope I had helped you, If you have any question, you can reply me.希望对你有所帮助,有什么问题可以回复我。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.