python在控制台输入密码但是不显示
import console; namespace console{ //控制台读取密码,并显示星号 getPassword = function(){ var tstr = {}; var input = kbRead(true); while( input.wVirtualKeyCode != 0xD/*_VK_ENTER*/ ){ if( input.uChar.asciiChar ){ ..table.push(tstr,input.uChar.asciiChar); if( input.uChar.asciiChar > 0x80){ ..table.push(tstr,kbRead(true).uChar.asciiChar); } ..io.stdout.write("*"); } input = kbRead(true); } ..io.stdout.write('\n'); return ..string.pack(tstr); } } io.open(); io.stdout.write("请输入密码:"); var pwd = console.getPassword(); import win; win.msgbox(pwd,"密码");