开发者

Python textbox program

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


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:

   abc = {"hello" : "HELLO!  THIS IS AN AUTOMATED REPLY!  :D"}

   print abc["hello"] 

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..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜