Python文本框程序
我想编写一个 Python 程序,能够将字典读取到任何(或大多数)文本框中。这可能吗?我将如何实现?
以下是我的意思的一个示例,第一行是我希望能够键入以接收第二行的命令的示例,第二行将是存储在字典值中的消息:
/alias hello
HELLO! THIS IS AN AUTOMATED REPLY! :D
I want to write a Python program that will be able to read from a dictionary into any (or most) textboxes. Will this be possible and how would I approach it?
Here is an example of what I mean with the first line being an example of a command I'd like to be able type to receive the 2nd line which would be the message stored in the dictionary value:
/alias hello
HELLO! THIS IS AN AUTOMATED REPLY! :D
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将字典存储为形式为 {key:value} 的键、值对。在关键部分写下您的命令,例如“hello”,并在值部分中给出相应的消息,例如“HELLO!”这是自动回复! :D'。您可以从其密钥访问您的值。例如:
它将打印“HELLO!这是自动回复!:D”。
我想这就是你的意思。其实我还没明白你说的文本框是什么意思。
Store the dictionary as key,value pair in the form {key:value}. In the key part write your commands like 'hello' and in the value part give your corresponding message like ' HELLO! THIS IS AN AUTOMATED REPLY! :D'. You can access your value from its key. For eg:
It will print "HELLO! THIS IS AN AUTOMATED REPLY! :D".
I think this is what you meant. Actually I haven't understood what you meant by textboxes..