首先,要导入使用库 random; ${phone} Evaluate random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8)) randomlog ${phone} 运行结果如下:…
服务端 #!/bin/sh # chkconfig: # description: Saves and restores system entropy pool for \ #create by xiaohu # #This script is the Rsync service script . /etc/init.d/functions case "$1" in start) echo "rsync is starting" /usr/local/rsyncd/…
通过re模块实现手机号码校验的脚本--json老师 import re 通过re模块实现手机号码校验的脚本--json老师 def mobile_validate(value): mobile_re = re.compile(r'^(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57]|19[012356789])[0-9]{8}$') if not mobile_re.match(value): raise ValidationError('手机号码格式错误…