【问题标题】:Relaunch a python script stopped by a CTRL+Z and containing a Fortran executable launched by os.system重新启动由 CTRL+Z 停止并包含由 os.system 启动的 Fortran 可执行文件的 python 脚本
【发布时间】:2020-03-27 08:08:33
【问题描述】:

我正在运行一个 Python 脚本,该脚本多次启动 Fortran 可执行文件(使用 os.system('./executable params.ini)

不幸的是,我执行了 CTRL+Z 来停止 python 脚本,但似乎我在执行 Fortran 可执行文件期间停止了它。

现在,无法重新启动 Python 脚本。我试过了。 :

fg %1

bg %1

kill -CONT pid_of_executable

但是什么都没发生……

那么,有没有办法重新启动 python 脚本?我很沮丧......如果有人能救我的命......(我在开玩笑)

更新 1: 一旦 Python 脚本被 CTRL+Z 停止,pa aux | grep compute 给出:

user1              38258   0.0  0.0  6121988  10324 s003  S     3:26PM   0:00.99 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python compute_Cl_variable_step_160_between_1e-8_and_1_values_Only_Omega_m_der_to_choose.py
user1              33564   0.0  0.0  6010372  16472 s012  S+    1:34PM   0:01.44 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python compute_Cl_variable_step_160_between_1e-8_and_1_values_Only_Omega_m_der_to_choose.py
user1              96299   0.0  0.0  6509060  12668 s004  S+    6:06PM   0:01.77 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python compute_Cl_variable_step_160_between_1e-8_and_1_values_Only_Omega_m_der_to_choose.py

【问题讨论】:

  • 是的,我可以看到它(带有 python 脚本名称的 compute 子字符串):ps aux | grep compute 给出:
  • user1 38258 0.0 0.0 6121988 10324 s003 S 3:26PM 0:00.99 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python compute_Cl_variable_step_160_between_1e-8_and_1_values_Only_Omega_m_der_to_choose.py user1 33564 0.0 0.0 6010372 16472 s012 S+ 1:34PM 0:01.44 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python compute_Cl_variable_step_160_between_1e-8_and_1_values_Only_Omega_m_der_to_choose.py
  • user1 96299 0.0 0.0 6509060 12668 s004 S+ 6:06PM 0:01.77 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python compute_Cl_variable_step_160_between_1e-8_and_1_values_Only_Omega_m_der_to_choose.py
  • @oguzismail 你认为它对我来说已经死了吗?

标签: bash shell jobs


【解决方案1】:

jobs

您可以看到暂停的作业

fg jobnummer 

会把它带回来。

【讨论】:

    猜你喜欢
    • 2014-12-23
    • 2016-10-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-31
    • 1970-01-01
    • 2013-06-01
    • 1970-01-01
    相关资源
    最近更新 更多