View Single Post
marxian's Avatar
Posts: 2,448 | Thanked: 9,523 times | Joined on Aug 2010 @ Wigan, UK
#2
One possible way is to use a QInputDialog via the PyQt bindings, but this requires an instance of QApplication (and thus an event loop). There is probably also a GTK equivalent. Another way is to use zenity http://library.gnome.org/users/zenity/stable/. It seems that the PyZenity module is not available for Maemo5, but you can use zenity via the os.system() method, e.g

Code:
import os

credentials = os.system('zenity --password --username').split('|')

if len(credentials) >= 2:
    username = credentials[0].strip()
    password = credentials[1].strip() // remove leading/trailing whitespace
else:
    print "Problem with username/password"
__________________
'Men of high position are allowed, by a special act of grace, to accomodate their reasoning to the answer they need. Logic is only required in those of lesser rank.' - J K Galbraith

My website

GitHub

Last edited by marxian; 2013-01-13 at 23:23.
 

The Following 2 Users Say Thank You to marxian For This Useful Post: