import csv
import random as r
def main():
c = r.sample(range(0,57), 10)
#生成含有10个不重复随机数的数组
list_all = []
#新建一个空链表用来存储谜语与谜底
list_be_chiose = []
#y用来存放被选中的题目
with open('儿童谜语集.csv','r',encoding='utf-8-sig') as f1:
批量修改linux服务器密码,同时生成execl表格
复制代码 代码如下:#!/usr/bin/env python#coding:utf8#随机生成自定义长度密码from random import choiceimport string,pickle
def GenPassword(length=8,chars=string.ascii_letters+string.digits): return ”.join([choice(chars) for i in range(length)