4/08/2011

python-dialog example code..

python-dialog example code..

The usage is quite straightforward... very simple and easy to use.



import dialog
import time

d = dialog.Dialog()
d.setBackgroundTitle('what the hell')

## choice menu
aa = d.menu("asdf", choices=[('1', '1 means 1'), ('2', '2 means 2')])
print aa

## file or directory selection
aa = d.fselect("/home/junseok/", 10, 30)
print aa

## displaying a progress bar (gauge)
d.gauge_start('babo', percent=0)
for loopi in range(11):
d.gauge_update(loopi*10)
time.sleep(1)
d.gauge_stop()

댓글 없음: