修改正在运行的python程序 [英] modify a running python program

查看:309
本文介绍了修改正在运行的python程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我启动了一个带有许多嵌套循环的python程序,该程序将花费几天的时间.我只是意识到循环值之一是错误的,并造成了无限循环.

I launched a python program with many nested loops, and the program will take days. I just realized that one of the loops values is wrong and makes a infinite loop.

我不想从零开始重新启动程序,是否有办法中断当前程序并修改循环范围,使其可以正常工作,以及是否陷入了无限循环来破坏程序?

I don't want to restart the program from zero, is there a way to interrupt the current program and modify the loop range so it will work properly and also if it was trapped with the infinite loop to break it?

非常感谢您的帮助.

推荐答案

如果程序不时保存其状态或结果,则可以添加逻辑来跳过已经执行的步骤.

If the program saves its state or its results from time to time, you could add a logic which skips the steps which have already executed.

否则,我看不到改变它的方法.

Otherwise, I don't see a way to change this.

这篇关于修改正在运行的python程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆