从WinXP控制台获取文本 [英] getting text from WinXP console

查看:79
本文介绍了从WinXP控制台获取文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


有谁知道如何从控制台窗口读取ASCII文本

(来自其他应用程序)在WinXP中?它听起来不像是一个主要的操作,但是虽然我可以通过pywin32找到窗口,但我还没有能够用它来做任何事情。我真的只想把

窗口文本变成一个字符串。


通过控制台窗口,我的意思是那种东西你来的时候出现

run" command" (虽然这个特别适合游戏NetHack)。


谢谢,

克里斯

Hello,

Does anyone know how I can read the ASCII text from a console window
(from another application) in WinXP? It doesn''t sound like a major
operation, but although I can find the window via pywin32, I haven''t
been able to do anything with it. I''d really just like to get the
window text into a string.

By "console window", I mean the sort of thing that comes up when you
run "command" (although this particular one is for the game NetHack).

Thanks,
Chris

推荐答案

你想要函数raw_input()。

你读过教程吗?我应该被覆盖在那里。

You want the function raw_input().
Have you read the tutorial? I should have been covered there.


Chris Rebert(cybercobra)写道:
Chris Rebert (cybercobra) wrote:
你想要函数raw_input()。<你读过这个教程吗?我应该被覆盖在那里。
You want the function raw_input().
Have you read the tutorial? I should have been covered there.




我很确定他正在寻找一种捕捉全部内容的方法

一个控制台窗口,而不仅仅是

让用户输入一些文本输入。


到OP:这是一个特定于操作系统的问题,而不是

Python问题,虽然你有很好的机会

从这里的某个人那里得到答案,如果你问的话,你的

机会甚至更高一些Windows

新闻组或邮件列表。 (但是,无论如何,请告诉我们

,无论如何都要找到答案。)


-Peter



I''m pretty sure he''s looking for a means of capturing
the entire contents of a console window, not just
letting the user enter some textual input.

To the OP: this is an OS-specific question, not a
Python question, and although you have a good chance
of getting an answer from someone here, your
chances are even higher if you ask in some Windows
newsgroup or mailing list. (But let us know when you
find the answer, in any case, for the archives.)

-Peter


On Sun,2005年3月20日17:19:16 -0500,Peter Hansen< pe *** @ engcorp.com>

在comp.lang中声明了以下内容。 python:
On Sun, 20 Mar 2005 17:19:16 -0500, Peter Hansen <pe***@engcorp.com>
declaimed the following in comp.lang.python:
我很确定他正在寻找一种方法来捕捉控制台窗口的全部内容,而不仅仅是让它们放弃用户输入一些文本输入。

更糟糕的是 - 他希望,当我读到它时,application-x捕获

运行application-y的控制台窗口的内容。


- ==================================== ============== ============<
wl ***** @ ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG<
wu******@dm.net | Bestiaria支持人员<
========================================= ========= ============<
主页:< http://www.dm.net/~wulfraed/> <
溢出页面:< http://wlfraed.home.netcom.com/> <
I''m pretty sure he''s looking for a means of capturing
the entire contents of a console window, not just
letting the user enter some textual input.
Even worse -- He wants, as I read it, application-x to capture
the contents of a console window running application-y.

-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.netcom.com/> <



这篇关于从WinXP控制台获取文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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