As stated in jedwards, use the setEchoModemethod :
Example:
from PyQt4 import QtGui, QtCore
app = QtGui.QApplication([])
pw = QtGui.QLineEdit()
pw.setEchoMode(QtGui.QLineEdit.Password)
pw.show()
app.exec_()
See also QLineEdit.EchoModeenum .
source
share