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目 标 场 景 平时在工作过程中,偶尔会需要大 ...
随机推荐
- keil编译STM32工程时 #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
我们可以双击错误,然后会自动定位到文件 stm32f10x.h 中出错的地方,可以看到代码: #if !defined (STM32F10X_LD) && !defined (STM3 ...
- Keil C51汉字显示的bug问题
一.缘起 这两天改进MCU的液晶显示方法,采用“即编即显”的思路,编写了一个可以直接显示字符串的程序.如程序调用disstr("我是你老爸");液晶屏上就会显示“我是你老爸”. 二 ...
- 转载 在.net中使用GAC
转载出处 https://blog.log4d.com/2011/01/gac/ GAC GAC是什么?是用来干嘛的?GAC的全称叫做全局程序集缓存,通俗的理解就是存放各种.net平台下面需要使用的d ...
- ELK beats平台介绍(11th)
beats是一个代理,将不同类型的数据发送到elasticsearch.beats可以直接将数据发送到elasticsearch,也可以通过logstash将数据发送elasticsearch. be ...
- create tablespace 与 heap_insert 函数
先说 heap_insert 函数: /* * heap_insert - insert tuple into a heap * * The new tuple is stamped with cur ...
- 传const引用代替传值
1.为什么使用传const引用? a.被调方法中,形参不再进行copy构造,以及析构,提高效率. b.传值,会出现对象切割的问题. 2.有没有例外? 在编译器底层,引用是使用指针实现的.这就意味着,如 ...
- zoj 3823 Excavator Contest 构造
Excavator Contest Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.zju.edu.cn/onlinejudge/show ...
- Web应用Word生成
前段时间接到一个Web应用自己主动生成Word的需求,现整理了下一些关键步骤拿来分享一下. 思路:(注:这里仅仅针对WORD2003版本号.其他版本号大同小异.) 由于WORD文件内部的数据及格式等是 ...
- GNU bash实现机制与源代码简析
http://www.cnblogs.com/napoleon_liu/archive/2011/04/01/2001886.html http://blog.csdn.net/ruglcc/arti ...
- VBScript
VBScript then PrintWMIErrorthenExit Err.Description, Err.Number else ifnot boolCathiMode then wscrip ...