这几天在做一个登陆的程序,需要将输入的密码屏蔽掉,自己百度,找到了两种方法,先贴下第一种方法,1 #include2 #include3 int main()4 {5 char *password;6 password=getpass("input passwd");7 pr...
分类:
系统相关 时间:
2015-05-18 20:21:28
阅读次数:
139
# _*_ coding: cp936 _*_ //支持中文格式import sys import getpass#admin configurationusername='cheeron'password='1234'counter = 0 #认证登录while True: if coun...
分类:
编程语言 时间:
2015-02-02 22:49:46
阅读次数:
270
getpass模块提供了可移植的密码输入,一共包括下面两个函数: 1. getpass.getpass() 2. getpass.getuser() getpass.getpass([prompt[, stream]]) 提示用户输入一段密码,参数prompt用于提示用户开始输入,默认为...
分类:
编程语言 时间:
2014-12-30 19:02:36
阅读次数:
189
测试环境:Ubuntu12.04python-pexpect安装:apt-getinstallpython-pexpect测试脚本:#!/usr/bin/envpython
importpxssh
importgetpass
try:
s=pxssh.pxssh()
hostname=raw_input(‘hostname:‘)
username=raw_input(‘username:‘)
password=getpass.getpass(‘pleaseinputpassword:..
分类:
其他好文 时间:
2014-12-19 15:59:04
阅读次数:
201
crypt(将密码或数据编码)相关函数getpass表头文件#define _XOPEN_SOURCE#include定义函数char * crypt (const char *key,const char * salt);函数说明crypt()将使用Data Encryption Standard...
分类:
编程语言 时间:
2014-11-10 01:06:52
阅读次数:
322
import sys,urllib,urllib2,getpass#定义TerminalPwd类扩展HTTPPasswordMgr,允许在需要的时候询问操作员输入密码class TerminalPwd(urllib2.HTTPPasswordMgr): def find_user_passwo...
分类:
编程语言 时间:
2014-10-12 20:24:08
阅读次数:
217