从Python中的code.interact()恢复代码执行 [英] Resume code execution from code.interact() in Python

查看:366
本文介绍了从Python中的code.interact()恢复代码执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用

code.interact(local=locals())

如何恢复代码执行。我已经检查了代码模块的文档并搜索了堆栈溢出,但找不到任何东西。

How can I resume code execution. I have checked the docs for the 'code' module and search stack overflow but cannot find anything.

推荐答案

这与您使用的方法相同退出任何Python解释器会话:发送文件结束符。

It's the same way you exit any Python interpreter session: send an end-of-file character.

在Linux上为 Ctrl - D Ctrl - Z 在Windows上输入。

That's Ctrl-D on Linux or Ctrl-Z Enter on Windows.

这篇关于从Python中的code.interact()恢复代码执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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