⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getpass.py

📁 python s60 1.4.5版本的源代码
💻 PY
字号:
import e32
import appuifw
import btconsole

def getpass(prompt='Password?'):
    if btconsole.inside_btconsole() or not e32.is_ui_thread():
        return raw_input(prompt)
    else:
        if isinstance(prompt,str):
            prompt=prompt.decode('utf8')
        reply=appuifw.query(prompt,'code')
        if reply is None:
            raise KeyboardInterrupt
        return reply

# This is a bit clumsy, but since the Symbian OS has no concept
# of a username, it's the best we can do.
def getuser(prompt='Username?'):
    if btconsole.inside_btconsole() or not e32.is_ui_thread():
        return raw_input(prompt)
    else:
        if isinstance(prompt,str):
            prompt=prompt.decode('utf8')
        reply=appuifw.query(prompt,'text')
        if reply is None:
            raise KeyboardInterrupt
        return reply

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -