如何一次运行多个python脚本?

如何一次运行多个python脚本?,python,cmd,module,pycharm,Python,Cmd,Module,Pycharm,我正在使用PyCharm编写一些python脚本。从PyCharm运行脚本效果很好,但我尝试将它们与批处理文件捆绑在一起,结果cmd出了问题: C:\Users\White Python\Desktop\Fran\theconfluence\graphs\leaderboard>python htmlcreator.py Traceback (most recent call last): File "htmlcreator.py", line 4, in

我正在使用PyCharm编写一些python脚本。从PyCharm运行脚本效果很好,但我尝试将它们与批处理文件捆绑在一起,结果cmd出了问题:

    C:\Users\White Python\Desktop\Fran\theconfluence\graphs\leaderboard>python htmlcreator.py
Traceback (most recent call last):
  File "htmlcreator.py", line 4, in <module>
    w = open(str(Path(__file__).parents[2]) + "/week.txt", "r")
  File "C:\Users\White Python\AppData\Local\Programs\Python\Python38-32\lib\pathlib.py", line 617, in __getitem__
    raise IndexError(idx)
IndexError: 2

C:\Users\White Python\Desktop\Fran\theconfluence\graphs\leaderboard>cd ..\retention

C:\Users\White Python\Desktop\Fran\theconfluence\graphs\retention>python creategraph.py
['C:\\Users\\White Python\\Desktop\\Fran\\theconfluence\\graphs\\retention', 'C:\\Users\\White Python\\AppData\\Local\\Programs\\Python
\\Python38-32\\python38.zip', 'C:\\Users\\White Python\\AppData\\Local\\Programs\\Python\\Python38-32\\DLLs', 'C:\\Users\\White Python\
\AppData\\Local\\Programs\\Python\\Python38-32\\lib', 'C:\\Users\\White Python\\AppData\\Local\\Programs\\Python\\Python38-32', 'C:\\Us
ers\\White Python\\AppData\\Local\\Programs\\Python\\Python38-32\\lib\\site-packages']
Traceback (most recent call last):
  File "creategraph.py", line 9, in <module>
    w = open(str(Path(__file__).parents[2]) + "/week.txt", "r")
  File "C:\Users\White Python\AppData\Local\Programs\Python\Python38-32\lib\pathlib.py", line 617, in __getitem__
    raise IndexError(idx)
IndexError: 2
C:\Users\White Python\Desktop\Fran\theconfluence\graphs\leadboard>Python htmlcreator.py
回溯(最近一次呼叫最后一次):
文件“htmlcreator.py”,第4行,在
w=open(str(路径(_文件__).parents[2])+“/week.txt”,“r”)
文件“C:\Users\White Python\AppData\Local\Programs\Python\Python38-32\lib\pathlib.py”,第617行,在u getitem中__
提升索引器(idx)
索引器:2
C:\Users\White Python\Desktop\Fran\theconfluence\graphs\Leadboard>cd..\retention
C:\Users\White Python\Desktop\Fran\theconfluence\graphs\retention>Python creategraph.py
['C:\\Users\\White Python\\Desktop\\Fran\\theconfluence\\graphs\\retention','C:\\Users\\White Python\\AppData\\Local\\Programs\\Python
\\Python38-32\\Python38.zip',C:\\Users\\White Python\\AppData\\Local\\Programs\\Python\\Python38-32\\DLLs',C:\\Users\\White Python\
\AppData\\Local\\Programs\\Python\\Python38-32\\lib','C:\\Users\\White Python\\AppData\\Local\\Programs\\Python\\Python38-32','C:\\Us
ers\\White Python\\AppData\\Local\\Programs\\Python\\Python38-32\\lib\\site packages']
回溯(最近一次呼叫最后一次):
文件“creategraph.py”,第9行,在
w=open(str(路径(_文件__).parents[2])+“/week.txt”,“r”)
文件“C:\Users\White Python\AppData\Local\Programs\Python\Python38-32\lib\pathlib.py”,第617行,在u getitem中__
提升索引器(idx)
索引器:2

其他不需要导入模块的脚本工作正常。救命啊

您的html创建者是脚本吗?还是更像模块?如果它像一个模块,请尝试:

python -m htmlcreator

您安装了scipy吗?是的,pip列表显示scipy。它显示“当前解释器:C:\Users\White Python\AppData\Local\Programs\Python\Python38-32\Python.exe”。实际上,我修复了scipy问题。我的路径混乱,python是从我下载的某个文件夹而不是实际的python文件夹运行的。我正在编辑问题,不知道有什么区别。无论如何,当我这样运行它时,我得到了如下结果:
(ModuleNotFoundError:\uuuu路径\uuuu属性在试图查找“htmlcreator.py”时在“htmlcreator”上找不到)
等等!它实际上是有效的,但前提是我删除“.py”。所以我把这个标记为已解决。谢谢