我怎样才能同时 运行 许多 python 脚本?
How can I run many python scripts at once?
我正在使用 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
其他不需要导入模块的脚本运行良好。求助!
您的html创作者是剧本吗?或者更像模块?如果它像一个模块 try:
python -m htmlcreator
我正在使用 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
其他不需要导入模块的脚本运行良好。求助!
您的html创作者是剧本吗?或者更像模块?如果它像一个模块 try:
python -m htmlcreator