Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions renzongxian/0001/0001.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

"""

做为 Apple Store App 独立开发者,你要搞限时促销,为你的应用生成激活码(或者优惠券),
使用 Python 如何生成 200 个激活码(或者优惠券)?
第 0001 题:做为 Apple Store App 独立开发者,你要搞限时促销,为你的应用生成激活码
(或者优惠券),使用 Python 如何生成 200 个激活码(或者优惠券)?

"""

Expand All @@ -22,3 +22,4 @@ def generate_key():

if __name__ == '__main__':
print(generate_key())

3 changes: 2 additions & 1 deletion renzongxian/0002/0002.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

"""

将 0001 题生成的 200 个激活码(或者优惠券)保存到 MySQL 关系型数据库中。
第 0002 题:将 0001 题生成的 200 个激活码(或者优惠券)保存到 MySQL 关系型数据库中。

"""

Expand Down Expand Up @@ -54,3 +54,4 @@ def write_to_mysql(key_list):

if __name__ == '__main__':
write_to_mysql(generate_key())

3 changes: 2 additions & 1 deletion renzongxian/0003/0003.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

"""

将 0001 题生成的 200 个激活码(或者优惠券)保存到 Redis 非关系型数据库中。
第 0003 题:将 0001 题生成的 200 个激活码(或者优惠券)保存到 Redis 非关系型数据库中。

"""

Expand All @@ -30,3 +30,4 @@ def write_to_redis(key_list):

if __name__ == '__main__':
write_to_redis(generate_key())

5 changes: 3 additions & 2 deletions renzongxian/0004/0004.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

"""

任一个英文的纯文本文件,统计其中的单词出现的个数。
第 0004 题:任一个英文的纯文本文件,统计其中的单词出现的个数。

"""

Expand All @@ -32,4 +32,5 @@ def word_count(file_path):
print("The total number of words is ", word_count(infile))
except IOError:
print("Can't open file!")
pass
pass

3 changes: 2 additions & 1 deletion renzongxian/0005/0005.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

"""

你有一个目录,装了很多照片,把它们的尺寸变成都不大于 iPhone5 分辨率(1136*640)的大小。
第 0005 题:你有一个目录,装了很多照片,把它们的尺寸变成都不大于 iPhone5 分辨率(1136*640)的大小。

"""

Expand Down Expand Up @@ -38,3 +38,4 @@ def resize_image(image):
for image_name in os.listdir(dir_path):
image_path = os.path.join(dir_path, image_name)
resize_image(image_path)