#!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 随机生成用户名、密码、手机号码的更多相关文章

  1. python随机生成个人信息

    python随机生成个人信息 #!/usr/bin/env python3 # -*- coding:utf-8 -*- import sys import random class Personal ...

  2. Python随机生成验证码的两种方法

    Python随机生成验证码的方法有很多,今天给大家列举两种,大家也可以在这个基础上进行改造,设计出适合自己的验证码方法方法一:利用range Python随机生成验证码的方法有很多,今天给大家列举两种 ...

  3. 用python随机生成数据,再插入到postgresql中

    用python随机生成学生姓名,三科成绩和班级数据,再插入到postgresql中. 模块用psycopg2 random import random import psycopg2 fname=[' ...

  4. linux下实用的快速随机生成复杂密码

    linux下实用的快速随机生成复杂密码 [root@test.db-audit.1 ~]# </dev/urandom tr -dc '1234567890!@#$%abcdefghigklmn ...

  5. Python 随机生成有效手机号码及身份证

    中国那么大,人那么多,几乎人手一部手机.手机号码已经作为各大互联网站的注册账户.同样,身份证更是如此.以下是生成有效手机号码和身份证号. 身份证需要下载districtcode.txt这个文件:htt ...

  6. python随机生成手机号码

    一句话生成电话号码random.choice(['139','188','185','136','158','151'])+"".join(random.choice(" ...

  7. Python批量生成用户名

    写在最前 平时在工作中尤其是在做压测的时候难免需要一些用户名和密码,写个简单的Python小脚本批量生成一些 代码示例 import random,string #生成大小字母和数字一起的大字符串 a ...

  8. python 随机生成固定长度的字串

    from random import Random#随机生成4到20位的用户名def random_username(): username = '' chars = 'AaBbCcDdEeFfGgH ...

  9. 如何用python批量生成真实的手机号码

    前言 文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理. 作者:Python测试社区 1目 标 场 景 平时在工作过程中,偶尔会需要大 ...

随机推荐

  1. SQL2008--行号的得到

    WITH DataTable AS( select *, ROW_NUMBER() OVER(order by ID) as Rowno from (select * from UserInfo) a ...

  2. 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 ...

  3. [iOS基础控件 - 5.2] 查看大图、缩放图片代码(UIScrollView制作)

    原图: 900 x 1305      拖曳滚动:   缩放:           主要代码: // // ViewController.m // ImageZoom // // Created by ...

  4. 转载 asp.net中ViewState的用法详解

    转载原地址: http://www.jb51.net/article/73662.htm 在web窗体控件设置为runat = "server",这个控件会被附加一个隐藏的属性_V ...

  5. Css基础-id选择器

    id 选择器以#来定义 <p id="pid">Hello css</p> #pid { color:red; } <div id="div ...

  6. Mysql 5.5 replication 多数据库主从备份Master-Slave配置总结

    配置Mysql server 5.5 的双机备份,也就是master-slave模式.本例子还是一个多database复制的情况. 现在有两个database在同一台mysql server,也就是m ...

  7. android Animation 动画效果介绍

    Android的animation由四种类型组成 XML中 alpha 渐变透明度动画效果 scale 渐变尺寸伸缩动画效果 translate 画面转换位置移动动画效果 rotate 画面转移旋转动 ...

  8. 用C# sqlserver实现增删改查

    using System.Data;using System.Data.SqlClient;//先打开两个类库文件SqlConnection con = new SqlConnection(); // ...

  9. MySQL导入txt文件

    "Flufy","Harold","cat","f","1993-2-4" "claws& ...

  10. linux文件 编辑常用 inux手把手vi ---针对文件操作

    命令语法 说明 使用频率(1:常用;2一般:3:偶尔) 1.VI编辑器的启动与退出 VI编辑器的启动与退出 vi  file1 新建一个文本文件名为file1 :q 退出,如果对缓存去进行过修改,则提 ...