<s> """<STR_LIT>""" <EOL> import sys <EOL> import web <EOL> try : <EOL> from PySide import QtCore <EOL> from PySide import QtGui <EOL> except ImportError : <EOL> from PyQt4 import QtCore <EOL> from PyQt4 import QtGui <EOL> class Demo ( QtGui . QWidget ) : <EOL> def __init__ ( self ) : <EOL> super ( Demo , self ) . __init__ ( ) <EOL> self . setGeometry ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> self . button = QtGui . QPushButton ( '<STR_LIT>' , self ) <EOL> self . button . setFocusPolicy ( QtCore . Qt . NoFocus ) <EOL> self . button . move ( <NUM_LIT:20> , <NUM_LIT:20> ) <EOL> self . connect ( self . button , QtCore . SIGNAL ( '<STR_LIT>' ) , <EOL> self . _get_input ) <EOL> self . setFocus ( ) <EOL> self . label = QtGui . QLineEdit ( self ) <EOL> self . label . move ( <NUM_LIT> , <NUM_LIT> ) <EOL> def _get_input ( self ) : <EOL> title , msg = '<STR_LIT>' , '<STR_LIT>' <EOL> text , resp = QtGui . QInputDialog . getText ( self , title , msg ) <EOL> if resp : <EOL> self . label . setText ( web . safeunicode ( text ) ) <EOL> def show_and_raise ( self ) : <EOL> self . show ( ) <EOL> self . raise_ ( ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> app = QtGui . QApplication ( sys . argv ) <EOL> demo = Demo ( ) <EOL> demo . show_and_raise ( ) <EOL> sys . exit ( app . exec_ ( ) ) </s>
