Need GUI pop-up to edit a (unicode ?) string

Rikishi42 skunkworks at rikishi42.net
Sun Jan 23 16:31:42 EST 2011


On 2011年01月22日, geremy condra <debatem1 at gmail.com> wrote:
> If windows doesn't matter to you, just use Zenity. Here's a python
> function wrapping zenity that does what you want:
>> import commands
>> def confirm_or_edit(s):
> zenity = 'zenity'
> mode = '--entry'
> text = "--text='Please confirm or edit the following string:'"
> title = "--title='confirm or edit'"
> entry = "--entry-text='%s'" % s
> cmd = ' '.join([zenity, mode, text, title, entry])
> status, output = commands.getstatusoutput(cmd)
> if status: raise Exception("Couldn't run zenity")
> return output
>> There's also a full-blown API for zenity, but this should do what you want.

Very, very nice. Thanks !
I'm amazed at how many GUI's are available.
No wonder I couldn't find "the" interface, there are too many. :-)
-- 
When in doubt, use brute force.
 -- Ken Thompson


More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /