Skip to content

Commit ceae3b5

Browse files
xuxu
authored andcommitted
readme and play1
1 parent 179039b commit ceae3b5

File tree

2 files changed

+203
-0
lines changed

2 files changed

+203
-0
lines changed

BrambleXu/README.md

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
## Python 练习册,每天一个小程序 ##
2+
3+
4+
#### 说明: ####
5+
6+
- Python 练习册,每天一个小程序。注:将 Python 换成其他语言,大多数题目也适用
7+
- 不会出现诸如「打印九九乘法表」、「打印水仙花」之类的题目
8+
- 本文本文由@史江歌([email protected] QQ:499065469)根据互联网资料收集整理而成,感谢互联网,感谢各位的分享。鸣谢!本文会不断更新。
9+
- 欢迎大家 Pull Request 出题目,贴代码(Gist、Blog皆可):-)
10+
- 欢迎解答, 并发送 pull request 到 [Show-Me-the-Code](https://github.com/Show-Me-the-Code/python)
11+
12+
> Talk is cheap. Show me the code.--Linus Torvalds
13+
14+
----------
15+
16+
**第 0000 题:**将你的 QQ 头像(或者微博头像)右上角加上红色的数字,类似于微信未读信息数量那种提示效果。
17+
类似于图中效果
18+
19+
![头像](http://i.imgur.com/sg2dkuY.png?1)
20+
21+
**第 0001 题:**做为 Apple Store App 独立开发者,你要搞限时促销,为你的应用**生成激活码**(或者优惠券),使用 Python 如何生成 200 个激活码(或者优惠券)?
22+
23+
**第 0002 题**:将 0001 题生成的 200 个激活码(或者优惠券)保存到 **MySQL** 关系型数据库中。
24+
25+
**第 0003 题:**将 0001 题生成的 200 个激活码(或者优惠券)保存到 **Redis** 非关系型数据库中。
26+
27+
**第 0004 题:**任一个英文的纯文本文件,统计其中的单词出现的个数。
28+
29+
**第 0005 题:**你有一个目录,装了很多照片,把它们的尺寸变成都不大于 iPhone5 分辨率的大小。
30+
31+
**第 0006 题:**你有一个目录,放了你一个月的日记,都是 txt,为了避免分词的问题,假设内容都是英文,请统计出你认为每篇日记最重要的词。
32+
33+
**第 0007 题:**有个目录,里面是你自己写过的程序,统计一下你写过多少行代码。包括空行和注释,但是要分别列出来。
34+
35+
**第 0008 题:**一个HTML文件,找出里面的**正文**
36+
37+
**第 0009 题:**一个HTML文件,找出里面的**链接**
38+
39+
**第 0010 题:**使用 Python 生成类似于下图中的**字母验证码图片**
40+
41+
![字母验证码](http://i.imgur.com/aVhbegV.jpg)
42+
43+
- [阅读资料](http://stackoverflow.com/questions/2823316/generate-a-random-letter-in-python)
44+
45+
**第 0011 题:** 敏感词文本文件 filtered_words.txt,里面的内容为以下内容,当用户输入敏感词语时,则打印出 Freedom,否则打印出 Human Rights。
46+
47+
北京
48+
程序员
49+
公务员
50+
领导
51+
牛比
52+
牛逼
53+
你娘
54+
你妈
55+
love
56+
sex
57+
jiangge
58+
59+
**第 0012 题:** 敏感词文本文件 filtered_words.txt,里面的内容 和 0011题一样,当用户输入敏感词语,则用 星号 * 替换,例如当用户输入「北京是个好城市」,则变成「**是个好城市」。
60+
61+
**第 0013 题:** 用 Python 写一个爬图片的程序,爬 [这个链接里的日本妹子图片 :-)](http://tieba.baidu.com/p/2166231880)
62+
63+
- [参考代码](http://www.v2ex.com/t/61686 "参考代码")
64+
65+
**第 0014 题:** 纯文本文件 student.txt为学生信息, 里面的内容(包括花括号)如下所示:
66+
67+
{
68+
"1":["张三",150,120,100],
69+
"2":["李四",90,99,95],
70+
"3":["王五",60,66,68]
71+
}
72+
73+
请将上述内容写到 student.xls 文件中,如下图所示:
74+
75+
![student.xls](http://i.imgur.com/nPDlpme.jpg)
76+
77+
- [阅读资料](http://www.cnblogs.com/skynet/archive/2013/05/06/3063245.html) 腾讯游戏开发 XML 和 Excel 内容相互转换
78+
79+
**第 0015 题:** 纯文本文件 city.txt为城市信息, 里面的内容(包括花括号)如下所示:
80+
81+
{
82+
"1" : "上海",
83+
"2" : "北京",
84+
"3" : "成都"
85+
}
86+
87+
请将上述内容写到 city.xls 文件中,如下图所示:
88+
89+
![city.xls](http://i.imgur.com/rOHbUzg.png)
90+
91+
92+
**第 0016 题:** 纯文本文件 numbers.txt, 里面的内容(包括方括号)如下所示:
93+
94+
[
95+
[1, 82, 65535],
96+
[20, 90, 13],
97+
[26, 809, 1024]
98+
]
99+
100+
请将上述内容写到 numbers.xls 文件中,如下图所示:
101+
102+
![numbers.xls](http://i.imgur.com/iuz0Pbv.png)
103+
104+
**第 0017 题:** 将 第 0014 题中的 student.xls 文件中的内容写到 student.xml 文件中,如
105+
106+
下所示:
107+
108+
<?xml version="1.0" encoding="UTF-8"?>
109+
<root>
110+
<students>
111+
<!--
112+
学生信息表
113+
"id" : [名字, 数学, 语文, 英文]
114+
-->
115+
{
116+
"1" : ["张三", 150, 120, 100],
117+
"2" : ["李四", 90, 99, 95],
118+
"3" : ["王五", 60, 66, 68]
119+
}
120+
</students>
121+
</root>
122+
123+
- [阅读资料](http://www.cnblogs.com/skynet/archive/2013/05/06/3063245.html) 腾讯游戏开发 xml 和 Excel 相互转换
124+
125+
**第 0018 题:** 将 第 0015 题中的 city.xls 文件中的内容写到 city.xml 文件中,如下所示:
126+
127+
<?xmlversion="1.0" encoding="UTF-8"?>
128+
<root>
129+
<citys>
130+
<!--
131+
城市信息
132+
-->
133+
{
134+
"1" : "上海",
135+
"2" : "北京",
136+
"3" : "成都"
137+
}
138+
</citys>
139+
</root>
140+
141+
**第 0019 题:** 将 第 0016 题中的 numbers.xls 文件中的内容写到 numbers.xml 文件中,如下
142+
143+
所示:
144+
145+
<?xml version="1.0" encoding="UTF-8"?>
146+
<root>
147+
<numbers>
148+
<!--
149+
数字信息
150+
-->
151+
152+
[
153+
[1, 82, 65535],
154+
[20, 90, 13],
155+
[26, 809, 1024]
156+
]
157+
158+
</numbers>
159+
</root>
160+
161+
**第 0020 题:** [登陆中国联通网上营业厅](http://iservice.10010.com/index_.html) 后选择「自助服务」 --> 「详单查询」,然后选择你要查询的时间段,点击「查询」按钮,查询结果页面的最下方,点击「导出」,就会生成类似于 2014年10月01日~2014年10月31日通话详单.xls 文件。写代码,对每月通话时间做个统计。
162+
163+
**第 0021 题:** 通常,登陆某个网站或者 APP,需要使用用户名和密码。密码是如何加密后存储起来的呢?请使用 Python 对密码加密。
164+
165+
- 阅读资料 [用户密码的存储与 Python 示例](http://zhuoqiang.me/password-storage-and-python-example.html)
166+
167+
- 阅读资料 [Hashing Strings with Python](http://www.pythoncentral.io/hashing-strings-with-python/)
168+
169+
- 阅读资料 [Python's safest method to store and retrieve passwords from a database](http://stackoverflow.com/questions/2572099/pythons-safest-method-to-store-and-retrieve-passwords-from-a-database)
170+
171+
**第 0022 题:** iPhone 6、iPhone 6 Plus 早已上市开卖。请查看你写得 第 0005 题的代码是否可以复用。
172+
173+
**第 0023 题:** 使用 Python 的 Web 框架,做一个 Web 版本 留言簿 应用。
174+
175+
[阅读资料:Python 有哪些 Web 框架](http://v2ex.com/t/151643#reply53)
176+
177+
- ![留言簿参考](http://i.imgur.com/VIyCZ0i.jpg)
178+
179+
180+
**第 0024 题:** 使用 Python 的 Web 框架,做一个 Web 版本 TodoList 应用。
181+
182+
- ![SpringSide 版TodoList](http://i.imgur.com/NEf7zHp.jpg)
183+
184+
**第 0025 题:** 使用 Python 实现:对着电脑吼一声,自动打开浏览器中的默认网站。
185+
186+
187+
例如,对着笔记本电脑吼一声“百度”,浏览器自动打开百度首页。
188+
189+
关键字:Speech to Text
190+
191+
参考思路:
192+
1:获取电脑录音-->WAV文件
193+
python record wav
194+
195+
2:录音文件-->文本
196+
197+
STT: Speech to Text
198+
199+
STT API Google API
200+
201+
3:文本-->电脑命令

BrambleXu/play1/play1.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# -*- coding:utf-8 -*-
2+
#**第 0001 题:**做为 Apple Store App 独立开发者,你要搞限时促销,为你的应用**生成激活码**(或者优惠券),使用 Python 如何生成 200 个激活码(或者优惠券)?

0 commit comments

Comments
 (0)