BBrother commited on
Commit
722181d
1 Parent(s): 3cfd6b9

Update nologs.py

Browse files
Files changed (1) hide show
  1. nologs.py +2 -2
nologs.py CHANGED
@@ -4,7 +4,7 @@ import logging
4
  import os
5
 
6
  # 检查是否存在 logs.txt 文件,如果存在则删除它
7
- log_file = '/bushu/logs.txt'
8
  if os.path.exists(log_file):
9
  os.remove(log_file)
10
 
@@ -26,7 +26,7 @@ try:
26
  # 在try块中运行v2_3.py,并将输出重定向到日志文件
27
  print ("开始运行安装文件...")
28
  with open(log_file, 'a') as log_file_handle:
29
- subprocess.run(['python', 'v2_3.py'], check=True, stdout=log_file_handle, stderr=subprocess.STDOUT)
30
  except subprocess.CalledProcessError as e:
31
  # 捕获异常并记录到日志文件
32
  logging.exception(f"程序发生异常: {e}")
 
4
  import os
5
 
6
  # 检查是否存在 logs.txt 文件,如果存在则删除它
7
+ log_file = '/content/logs.txt'
8
  if os.path.exists(log_file):
9
  os.remove(log_file)
10
 
 
26
  # 在try块中运行v2_3.py,并将输出重定向到日志文件
27
  print ("开始运行安装文件...")
28
  with open(log_file, 'a') as log_file_handle:
29
+ subprocess.run(['python', 'BuShu.py'], check=True, stdout=log_file_handle, stderr=subprocess.STDOUT)
30
  except subprocess.CalledProcessError as e:
31
  # 捕获异常并记录到日志文件
32
  logging.exception(f"程序发生异常: {e}")