![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
Molly Wang
业余选手
展开
-
6.7 printTable(table) -《automate the boring stuff with python》
新手上路,首次分享。考虑到了不规则列表,将原tableData稍作了改动。tableData = [['apples', 'oranges', 'cherries', 'banana', 'test1'], ['Alice', 'Bob', ' ','Carol', 'David'], ['dogs', 'cats', 'moose', 'g...原创 2018-12-20 14:21:04 · 152 阅读 · 0 评论 -
7.18.1 detection(password) -《automate the boring stuff with python》
假定两点:这是一个创建口令的场景;创建者知道强口令的定义,即长度不小于8个字符,同时包含大写和小写字符,至少有一位数字。那么:无需限制尝试的次数;无需使用print()提示强口令的定义。import redef detection(password): upperCheckRegex = re.compile(r'[A-Z]+') lowerCheckRe...原创 2018-12-22 15:16:40 · 325 阅读 · 0 评论 -
7.18.2 reStrip(text, chars=None) -《automate the boring stuff with python》
strip()的正则表达式版本import redef reStrip(text, chars=None): if chars is None: regex = re.compile(r'^\s*|\s*$') else: regex = re.compile(r'^[' + chars + ']*|[' + chars + ']*$') ...原创 2018-12-24 15:25:08 · 308 阅读 · 0 评论 -
MAC终端运行.py文件
1、cd到py文件的目录cd /Users/li.wang/GoogleDrive/python/novabeyond2、修改py文件的权限为可执行权限chmod 777 run_all_like.py3、运行py文件python3 run_all_like.py原创 2019-09-01 00:59:01 · 543 阅读 · 0 评论