# -*- coding:utf-8 -*-
import random
# 判断第一个字符串是否是第二个字符串的子串
'''
strA="hello"
strB="helloWorld"
if strA in strB:
print("yes")
else:
print(no)
'''
#移位操作,判断str1是否是str2移动n位后的,需要for循环,未完成
'''
def setups(strs,setup):
print(type(setup))
setup2=setup%len(strs)
ret_str=strs[-setup2:]+strs[:-setup2]
return ret_str
str1='欢迎来到我的博客'
str=setups(str1,2)
print(str)
'''
# 随机彩票号码
'''
ssq_qian=[i for i in range(1,34)]
ssq_hou=[i for i in range(1,17)]
qian_random=random.sample(ssq_qian,k=6)
hou_random=random.sample(ssq_hou,k=1)
qian_random.sort(reverse=True)
print(qian_random)
print(hou_random)
'''
# 随机扑克牌
'''
poker_num=[str(i) for i in range(2,11)]
poker_str=['A','J','Q','K']
poker_king=['大王','小王']
poker_color=['黑','红','梅','方']
pokers=["%s%s"%(i,j) for i in poker_color for j in poker_num+poker_str] + poker_king
random.shuffle(pokers)
person_a=pokers[0:51:3]
person_b=pokers[1:51:3]
person_c=pokers[2:51:3]
last=pokers[-3:]
print(len(person_a))
print(len(person_b))
print(len(person_c))
print(last)
'''
# 快速生成二维码,这个模块在osX系统无法成功执行,Windows未试
# 先安装模块 pip3 install qrcode
import qrcode
# 简单实例
# a = qrcode.make("http:www.baidu.com")
# a.save("百度网站二维码.png")
# 详细实例
'''
qr=qrcode.QRCode(
version=1,
error_correction=qrcode.ERROR_CORRECT_Q,
box_size=4,
border=2
)
qr.add_data("www.baidu.com")
qr.make(fit=True)
img=qr.make_image(fill_color="yellow",back_color="blue")
img.save('百度.png')
'''
import random
# 判断第一个字符串是否是第二个字符串的子串
'''
strA="hello"
strB="helloWorld"
if strA in strB:
print("yes")
else:
print(no)
'''
#移位操作,判断str1是否是str2移动n位后的,需要for循环,未完成
'''
def setups(strs,setup):
print(type(setup))
setup2=setup%len(strs)
ret_str=strs[-setup2:]+strs[:-setup2]
return ret_str
str1='欢迎来到我的博客'
str=setups(str1,2)
print(str)
'''
# 随机彩票号码
'''
ssq_qian=[i for i in range(1,34)]
ssq_hou=[i for i in range(1,17)]
qian_random=random.sample(ssq_qian,k=6)
hou_random=random.sample(ssq_hou,k=1)
qian_random.sort(reverse=True)
print(qian_random)
print(hou_random)
'''
# 随机扑克牌
'''
poker_num=[str(i) for i in range(2,11)]
poker_str=['A','J','Q','K']
poker_king=['大王','小王']
poker_color=['黑','红','梅','方']
pokers=["%s%s"%(i,j) for i in poker_color for j in poker_num+poker_str] + poker_king
random.shuffle(pokers)
person_a=pokers[0:51:3]
person_b=pokers[1:51:3]
person_c=pokers[2:51:3]
last=pokers[-3:]
print(len(person_a))
print(len(person_b))
print(len(person_c))
print(last)
'''
# 快速生成二维码,这个模块在osX系统无法成功执行,Windows未试
# 先安装模块 pip3 install qrcode
import qrcode
# 简单实例
# a = qrcode.make("http:www.baidu.com")
# a.save("百度网站二维码.png")
# 详细实例
'''
qr=qrcode.QRCode(
version=1,
error_correction=qrcode.ERROR_CORRECT_Q,
box_size=4,
border=2
)
qr.add_data("www.baidu.com")
qr.make(fit=True)
img=qr.make_image(fill_color="yellow",back_color="blue")
img.save('百度.png')
'''