随机形成字母和数字组成的五位字符码。 [root@localhost python]# vim timee.py import random def coder(): code = '' for i in range(5): add = random.choice([random.randrange... ...
分类:
编程语言 时间:
2018-02-04 19:35:28
阅读次数:
114
一、SQLAlchemy-Utils 由于sqlalchemy中没有提供choice方法,所以借助SQLAlchemy-Utils组件提供的choice方法 import datetime from sqlalchemy import create_engine from sqlalchemy.ex ...
分类:
数据库 时间:
2018-02-04 12:46:24
阅读次数:
234
1.创建一个空列表,命名为names,往里面添加old_driver,rain,jack,shanshan,peiqi,black_girl元素 2.往names列表里black_girl前面插入一个alex 1 ...
分类:
编程语言 时间:
2018-02-03 23:05:33
阅读次数:
950
The secret of success is to do the common things uncommonly well. 成功的秘诀就是把平凡的事情做得异常的好。 Sometimes your choice and your luck may play a much more import ...
分类:
其他好文 时间:
2018-01-23 20:35:56
阅读次数:
184
import random import string print(random.randint(1, 199)) # [1,199]随机取一个整数 s = random.choice(['qwe', 'wer', 'ert']) # 随机取一个元素 print(s) print(string.di ...
分类:
编程语言 时间:
2018-01-21 00:03:25
阅读次数:
181
1、random随机数 2、string取大小写字母特殊字符 ...
分类:
编程语言 时间:
2018-01-19 19:49:20
阅读次数:
248
# 过滤补充; # 点击userprofile表报错; # 因为当没有自定义admin_class时,默认使用的是BaseKingAdmin; # 所以,BaseKingAdmin需要做一些默认的配置; # admin_base.py class BaseKingAdmin(object): lis... ...
分类:
其他好文 时间:
2018-01-18 14:10:17
阅读次数:
150
#!/usr/bin/python#--coding:utf8--importrandom#导入随机数的模块computer=random.choice([‘石头‘,‘剪刀‘,‘布‘])player=raw_input(‘请出拳(石头/剪刀/布):‘)print"Yourchoice:%s,Computer‘scho
分类:
编程语言 时间:
2018-01-17 01:04:34
阅读次数:
230
#!/usr/bin/python#--coding:utf8--importrandom#导入随机数的模块computer=random.choice([‘石头‘,‘剪刀‘,‘布‘])player=raw_input(‘请出拳(石头/剪刀/布):‘)print"Yourchoice:%s,Computer‘scho
分类:
编程语言 时间:
2018-01-16 23:58:46
阅读次数:
338
常用模块 一、random模块 生成随机码 二、os模块 ...
分类:
编程语言 时间:
2018-01-15 16:30:28
阅读次数:
133