python 随机生成用户名、密码、手机号码
#!C:\Python
#!/usr/bin/env python
#-*- coding:utf-8 -*- import string
import random minlength = 6
maxlength = 16 mobile_begin_seed = ['','','','','','','','','','','','','','','','','','','','','','','','','','','','','','']
mobile_seed = string.digits
username_seed = string.digits+string.ascii_letters
password_seed = string.digits+string.ascii_letters+string.punctuation mobile = random.choice(mobile_begin_seed)+''.join(random.choice(mobile_seed) for m in range(8))
username = ''.join(random.choice(username_seed) for u in range(random.randint(minlength,maxlength)))
password = ''.join(random.choice(password_seed) for p in range(random.randint(minlength,maxlength))) with open("E:\log.log",'a') as log,open ("E:\mobile.txt",'a') as phone:
log.write(username +'\n')
log.write(password +'\n')
phone.write(mobile +'\n') print "The random generation mobile is:",mobile
print "The random generation username is:",username
print "The random generation password is:",password
python 随机生成用户名、密码、手机号码的更多相关文章
- python随机生成个人信息
python随机生成个人信息 #!/usr/bin/env python3 # -*- coding:utf-8 -*- import sys import random class Personal ...
- Python随机生成验证码的两种方法
Python随机生成验证码的方法有很多,今天给大家列举两种,大家也可以在这个基础上进行改造,设计出适合自己的验证码方法方法一:利用range Python随机生成验证码的方法有很多,今天给大家列举两种 ...
- 用python随机生成数据,再插入到postgresql中
用python随机生成学生姓名,三科成绩和班级数据,再插入到postgresql中. 模块用psycopg2 random import random import psycopg2 fname=[' ...
- linux下实用的快速随机生成复杂密码
linux下实用的快速随机生成复杂密码 [root@test.db-audit.1 ~]# </dev/urandom tr -dc '1234567890!@#$%abcdefghigklmn ...
- Python 随机生成有效手机号码及身份证
中国那么大,人那么多,几乎人手一部手机.手机号码已经作为各大互联网站的注册账户.同样,身份证更是如此.以下是生成有效手机号码和身份证号. 身份证需要下载districtcode.txt这个文件:htt ...
- python随机生成手机号码
一句话生成电话号码random.choice(['139','188','185','136','158','151'])+"".join(random.choice(" ...
- Python批量生成用户名
写在最前 平时在工作中尤其是在做压测的时候难免需要一些用户名和密码,写个简单的Python小脚本批量生成一些 代码示例 import random,string #生成大小字母和数字一起的大字符串 a ...
- python 随机生成固定长度的字串
from random import Random#随机生成4到20位的用户名def random_username(): username = '' chars = 'AaBbCcDdEeFfGgH ...
- 如何用python批量生成真实的手机号码
前言 文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理. 作者:Python测试社区 1目 标 场 景 平时在工作过程中,偶尔会需要大 ...
随机推荐
- poll()
# include < sys/ poll. h> int poll ( struct pollfd * fds, unsigned int nfds, int timeout) ; 和s ...
- passport.js
$(function(){ function isPlaceholder(){ var input = document.createElement('input'); return 'placeho ...
- Android 命名规范和编码规范
简明概要 多写注释 一.关于命名规范 对于开发项目来说肯定是要有统一的规范,然而命名规范需要做到哪几点呢? 答: 首先,不能反人类. 再来就是,要望文而知其意. 下面就来说说具体该怎么去规范我们的代 ...
- 搭架私有Git服务器Gogs
博客搬到了fresky.github.io - Dawei XU,请各位看官挪步.最新的一篇是:搭架私有Git服务器Gogs.
- Struts2中的session、request、respsonse获取方法
个人对于struts有一种复杂的心情,平心而论,struts2是个人最早接触到的的框架,在学校的时候就已经开始学习了,大四毕业设计,无疑用的还是struct,那时候SSH还是很流行的,后来出来实习,直 ...
- 淘宝IP地址查询
官方网址:http://ip.taobao.com/index.php 相关文章: http://www.cnblogs.com/zetee/p/3482085.html http://www.cnb ...
- iOS UITabBarItem 选中图的颜色,设置UIimage的渲染模式
UITbarController之前有在这篇文章讲解:http://www.cnblogs.com/niit-soft-518/p/4447940.html 如果自定义了UITabBarItem的图片 ...
- [AngularJS - thoughtram] Exploring Angular 1.3: Binding to Directive Controllers
The post we have: http://www.cnblogs.com/Answer1215/p/4185504.html gives a breif introduce about bin ...
- 设计模式 - 命令模式(command pattern) 多命令 具体解释
命令模式(command pattern) 多命令 具体解释 本文地址: http://blog.csdn.net/caroline_wendy 參考命令模式: http://blog.csdn.ne ...
- C语言register关键字—最快的关键字
register:这个关键字请求编译器尽可能的将变量存在CPU内部寄存器中,而不是通过内存寻址访问,以提高效率.注意是尽可能,不是绝对.你想想,一个CPU 的寄存器也就那么几个或几十个,你要是 ...