PS D:\MINICONDA> d:; cd 'd:\MINICONDA'; & 'D:\miniconda\python.exe' 'c:\Users\Admin\.vscode\extensions\ms-python.python-2023.4.1\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '61917' '--' 'D:\MINICONDA\pachong.py' Traceback (most recent call last): File "D:\miniconda\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "D:\miniconda\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "c:\Users\Admin\.vscode\extensions\ms-python.python-2023.4.1\pythonFiles\lib\python\debugpy\__main__.py", line 39, in <module> cli.main() File "c:\Users\Admin\.vscode\extensions\ms-python.python-2023.4.1\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 430, in main run() File "c:\Users\Admin\.vscode\extensions\ms-python.python-2023.4.1\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 284, in run_file runpy.run_path(target, run_name="__main__") File "c:\Users\Admin\.vscode\extensions\ms-python.python-2023.4.1\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 320, in run_path code, fname = _get_code_from_file(run_name, path_name) File "c:\Users\Admin\.vscode\extensions\ms-python.python-2023.4.1\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 294, in _get_code_from_file code = compile(f.read(), fname, 'exec') File "D:\MINICONDA\pachong.py", line 10 soup = BeautifulSoup(response.text, 'html.parser') ^ IndentationError: expected an indented block after 'if' statement on line 8
时间: 2023-07-17 15:03:52 浏览: 189
这个错误是缩进错误(IndentationError)。根据错误提示,它指出在第8行的if语句后面没有缩进的代码块。请确保在条件语句的下一行开始一个缩进的代码块。例如:
```python
if condition:
# 缩进的代码块
# 在这里执行一些操作
```
请检查你的代码,确保在第8行之后有正确的缩进。如果你能提供代码的相关部分,我可以更具体地帮助你解决问题。
相关问题
export PATH=/home/tangyd/miniconda3/bin:$PATH cd /home/tangyd/code/highthrow-flask ps -ef|grep /home/tangyd/code/highthrow-flask/app.py | awk '{print $2}' |xargs kill -9 nohup python /home/tangyd/code/highthrow-flask/app.py > /var/log/highthrow-flask.log
这是一段 Shell 命令,包括了三个部分。第一个部分是设置环境变量,将 /home/tangyd/miniconda3/bin 添加到 PATH 环境变量中。第二个部分是切换到 /home/tangyd/code/highthrow-flask 目录下。第三个部分是启动一个 Flask 应用程序,首先使用 ps 命令查找正在运行的 app.py 进程,并使用 awk 命令提取进程 ID,最后使用 kill 命令杀死进程。然后使用 nohup 命令在后台运行 app.py,并将输出重定向到 /var/log/highthrow-flask.log 文件中。
阅读全文