我试图准确了解如何使用 cmd 模块
首先我要说的是:我是 Pyhon 的新手!我编写了一堆模块来通过命令行驱动用户交互式应用程序。此外,有人建议我考虑使用 cmd 模块。我在一些网站上看过它,但仍然不确定如何使用它。我没有阅读障碍或类似的问题,但我很难消化技术文献(没有示例)......我是一名视觉学习者,如果我一次能看到一个好的、清晰的示例,那就是与我共度一生。谁能给我一个关于如何使用 cmd 模块的简短介绍...?在那之前,我将继续在谷歌上寻找好的例子。我可能会幸运......谢谢!
Let me preface this by saying: I'm a neophyte to Pyhon! I've written a bunch of modules to drive a user interactive application via the command line. Additionally, someone recommended that I look at using the cmd module. And I've looked at it on some sites, but still not sure how to use it. I don't have dyslexia or anything like that, but I have a really tough time digesting technical literature (with no examples) ... I'm a visual learner, and if I can see a good, clear example one time, it's with me for a life time. Can anyone give me a short intro on how to use the cmd module ...? Until then, I will continue to scour Google for good examples. I might get lucky ... Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Doug Hellmann 的 本周 Python 模块系列 有 使用的好例子
cmd
模块。另一个很好的例子是 ActiveState 食谱“使用 Cmd 对象构建的控制台”,但我认为它更复杂。 ActiveState Python 食谱 和 PyMOTW 是 Python 示例的良好来源。
您还可以看到
cmd
模块的源代码 的内容来了解它是如何工作的,您可能会喜欢cmd2
模块也是。Doug Hellmann's Python Module of the Week series has a good example of using the
cmd
module.Another good example is the ActiveState recipe "Console built with Cmd object", but I think it is more complicated. ActiveState Python recipes and PyMOTW are good sources for python examples.
You could also see the
cmd
module's source to understand how it works, and you may like thecmd2
module too.Catherine Devlin 在去年的 PyCon 上做了一个关于 cmd 和 cmd2 入门的非常精彩的演讲。
视频可以在 pyvideo 上找到。
视频、代码和幻灯片曾经位于 Pycon 网站 上,但现在链接现已失效。
There was a very nice presentation by Catherine Devlin at last years PyCon about getting started with cmd and cmd2.
Video can be found on pyvideo.
Video, code and slides used to be on the Pycon website but that link is now dead.