def login_in_terminal(self, need_captcha=False, use_getpass=True):
print('<STR_LIT>')<EOL>email = input('<STR_LIT>')<EOL>if use_getpass:<EOL><INDENT>password = getpass.getpass('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>password = input("<STR_LIT>")<EOL><DEDENT>if need_captcha:<EOL><INDENT>captcha_data = self.get_captcha()<EOL>with open('<STR_LIT>', '<STR_LIT:wb>') as f:<EOL><INDENT>f.write(captcha_data)<EOL><DEDENT>print('<STR_LIT>')<EOL>captcha = input('<STR_LIT>')<EOL>os.remove('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>captcha = None<EOL><DEDENT>print('<STR_LIT>')<EOL>code, msg, cookies = self.login(email, password, captcha)<EOL>if code == <NUM_LIT:0>:<EOL><INDENT>print('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>print('<STR_LIT>'.format(msg))<EOL><DEDENT>return cookies<EOL>
不使用cookies，在终端中根据提示登陆知乎

        :param bool need_captcha: 是否要求输入验证码，如果登录失败请设为 True
        :param bool use_getpass: 是否使用安全模式输入密码，默认为 True，
            如果在某些 Windows IDE 中无法正常输入密码，请把此参数设置为 False 试试
        :return: 如果成功返回cookies字符串
        :rtype: str