在 Windows 中运行/调试 python 程序的最简洁方法 [英] Cleanest way to run/debug python programs in windows

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

问题描述

Python for Windows 默认带有 IDLE,这是我遇到过的最简单的 IDE.编辑文件,我会坚持使用emacs,非常感谢.

Python for Windows by default comes with IDLE, which is the barest-bones IDE I've ever encountered. For editing files, I'll stick to emacs, thank you very much.

但是,我想在其他 shell 中运行程序,而不是蹩脚的 Windows 命令提示符,它不能扩展到超过 80 个字符.

However, I want to run programs in some other shell than the crappy windows command prompt, which can't be widened to more than 80 characters.

IDLE 允许我在其中运行程序如果我打开文件,然后按 F5(转到运行"->运行模块").我宁愿只是运行"命令,而不是通过关闭 emacs 文件、加载 IDLE 文件等的繁琐程序. 对 google 和 IDLE 文档的扫描似乎对使用 IDLE 的帮助不大shell 但不是 IDE.

IDLE lets me run programs in it if I open the file, then hit F5 (to go Run-> Run Module). I would rather like to just "run" the command, rather than going through the rigmarole of closing the emacs file, loading the IDLE file, etc. A scan of google and the IDLE docs doesn't seem to give much help about using IDLE's shell but not it's IDE.

堆栈溢出的人有什么建议吗?理想情况下,我要么喜欢

Any advice from the stack overflow guys? Ideally I'd either like

  • 关于使用 IDLE 的 shell 运行程序的建议

  • advice on running programs using IDLE's shell

关于在 IDLE 或cmd"之外的 Windows 中运行 Python 程序的其他方法的建议.

advice on other ways to run python programs in windows outside of IDLE or "cmd".

谢谢,

/YGA

推荐答案

对于交互式解释器,没有什么比 IPython.太棒了它也是免费和开源的.在 Windows 上,您需要安装 readline 库.IPython 安装文档中提供了相关说明.

For an interactive interpreter, nothing beats IPython. It's superb. It's also free and open source. On Windows, you'll want to install the readline library. Instructions for that are on the IPython installation documentation.

Winpdb 是我选择的 Python 调试器.它是免费的、开源的、跨平台的(使用 wxWidgets 作为 GUI).我写了一个如何使用 Winpdb 的教程来帮助人们开始使用图形调试器.

Winpdb is my Python debugger of choice. It's free, open source, and cross platform (using wxWidgets for the GUI). I wrote a tutorial on how to use Winpdb to help get people started on using graphical debuggers.

这篇关于在 Windows 中运行/调试 python 程序的最简洁方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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