{"id":15031691,"url":"https://github.com/yixiaohan/show-me-the-code","last_synced_at":"2025-05-14T02:04:16.089Z","repository":{"id":20376589,"uuid":"23652091","full_name":"Yixiaohan/show-me-the-code","owner":"Yixiaohan","description":"Python 练习册，每天一个小程序","archived":false,"fork":false,"pushed_at":"2019-11-11T04:02:04.000Z","size":24,"stargazers_count":13458,"open_issues_count":2,"forks_count":4711,"subscribers_count":1297,"default_branch":"master","last_synced_at":"2025-04-10T16:48:01.460Z","etag":null,"topics":["python","python-web","tutorial"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Yixiaohan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-04T07:02:34.000Z","updated_at":"2025-04-10T02:53:03.000Z","dependencies_parsed_at":"2022-07-21T22:02:50.700Z","dependency_job_id":null,"html_url":"https://github.com/Yixiaohan/show-me-the-code","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yixiaohan%2Fshow-me-the-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yixiaohan%2Fshow-me-the-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yixiaohan%2Fshow-me-the-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yixiaohan%2Fshow-me-the-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yixiaohan","download_url":"https://codeload.github.com/Yixiaohan/show-me-the-code/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254052679,"owners_count":22006716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","python-web","tutorial"],"created_at":"2024-09-24T20:16:20.456Z","updated_at":"2025-05-14T02:04:16.056Z","avatar_url":"https://github.com/Yixiaohan.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"## Python 练习册，每天一个小程序 ##\n\n\n#### 说明： ####\n\n- Python 练习册，每天一个小程序。注：将 Python 换成其他语言，大多数题目也适用\n- 不会出现诸如「打印九九乘法表」、「打印水仙花」之类的题目\n- [点此链接，会看到部分题目的代码，仅供参考](https://github.com/Show-Me-the-Code/python)\n- 本文本文由@史江歌（shijiangge@gmail.com  QQ:499065469）根据互联网资料收集整理而成，感谢互联网，感谢各位的分享。鸣谢！本文会不断更新。\n\n\u003e Talk is cheap. Show me the code.--Linus Torvalds\n\n----------\n \n**第 0000 题：** 将你的 QQ 头像（或者微博头像）右上角加上红色的数字，类似于微信未读信息数量那种提示效果。\n类似于图中效果\n\n![头像](http://i.imgur.com/sg2dkuY.png?1)\n\n**第 0001 题：** 做为 Apple Store App 独立开发者，你要搞限时促销，为你的应用**生成激活码**（或者优惠券），使用 Python 如何生成 200 个激活码（或者优惠券）？\n\n**第 0002 题:** 将 0001 题生成的 200 个激活码（或者优惠券）保存到 **MySQL** 关系型数据库中。 \n\n**第 0003 题：** 将 0001 题生成的 200 个激活码（或者优惠券）保存到 **Redis** 非关系型数据库中。 \n\n**第 0004 题：** 任一个英文的纯文本文件，统计其中的单词出现的个数。\n\n**第 0005 题：** 你有一个目录，装了很多照片，把它们的尺寸变成都不大于 iPhone5 分辨率的大小。\n\n**第 0006 题：** 你有一个目录，放了你一个月的日记，都是 txt，为了避免分词的问题，假设内容都是英文，请统计出你认为每篇日记最重要的词。\n\n**第 0007 题：** 有个目录，里面是你自己写过的程序，统计一下你写过多少行代码。包括空行和注释，但是要分别列出来。\n\n**第 0008 题：** 一个HTML文件，找出里面的**正文**。\n\n**第 0009 题：** 一个HTML文件，找出里面的**链接**。\n\n**第 0010 题：** 使用 Python 生成类似于下图中的**字母验证码图片**\n\n![字母验证码](http://i.imgur.com/aVhbegV.jpg)\n\n- [阅读资料](http://stackoverflow.com/questions/2823316/generate-a-random-letter-in-python) \n\n**第 0011 题：** 敏感词文本文件 filtered_words.txt，里面的内容为以下内容，当用户输入敏感词语时，则打印出 Freedom，否则打印出 Human Rights。\n\n    北京\n    程序员\n    公务员\n    领导\n    牛比\n    牛逼\n    你娘\n    你妈\n    love\n    sex\n\tjiangge\n\t\n**第 0012 题：** 敏感词文本文件 filtered_words.txt，里面的内容 和 0011题一样，当用户输入敏感词语，则用 星号 * 替换，例如当用户输入「北京是个好城市」，则变成「**是个好城市」。\n\n**第 0013 题：** 用 Python 写一个爬图片的程序，爬 [这个链接里的日本妹子图片 :-)](http://tieba.baidu.com/p/2166231880)\n\n- [参考代码](http://www.v2ex.com/t/61686 \"参考代码\")\n\n**第 0014 题：** 纯文本文件 student.txt为学生信息, 里面的内容（包括花括号）如下所示：\n\n    {\n    \t\"1\":[\"张三\",150,120,100],\n    \t\"2\":[\"李四\",90,99,95],\n    \t\"3\":[\"王五\",60,66,68]\n    }\n\n请将上述内容写到 student.xls 文件中，如下图所示：\n\n![student.xls](http://i.imgur.com/nPDlpme.jpg)\n\n- [阅读资料](http://www.cnblogs.com/skynet/archive/2013/05/06/3063245.html) 腾讯游戏开发 XML 和 Excel 内容相互转换\n\n**第 0015 题：** 纯文本文件 city.txt为城市信息, 里面的内容（包括花括号）如下所示：\n\n    {\n        \"1\" : \"上海\",\n        \"2\" : \"北京\",\n        \"3\" : \"成都\"\n    }\n\n请将上述内容写到 city.xls 文件中，如下图所示：\n\n![city.xls](http://i.imgur.com/rOHbUzg.png)\n\n\n**第 0016 题：** 纯文本文件 numbers.txt, 里面的内容（包括方括号）如下所示：\n\n    [\n    \t[1, 82, 65535], \n    \t[20, 90, 13],\n    \t[26, 809, 1024]\n    ]\n\n请将上述内容写到 numbers.xls 文件中，如下图所示：\n\n![numbers.xls](http://i.imgur.com/iuz0Pbv.png)\n\n**第 0017 题：** 将 第 0014 题中的 student.xls 文件中的内容写到 student.xml 文件中，如\n\n下所示：\n\n    \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n    \u003croot\u003e\n    \u003cstudents\u003e\n    \u003c!-- \n    \t学生信息表\n    \t\"id\" : [名字, 数学, 语文, 英文]\n    --\u003e\n    {\n    \t\"1\" : [\"张三\", 150, 120, 100],\n    \t\"2\" : [\"李四\", 90, 99, 95],\n    \t\"3\" : [\"王五\", 60, 66, 68]\n    }\n    \u003c/students\u003e\n    \u003c/root\u003e\n\n\n**第 0018 题：** 将 第 0015 题中的 city.xls 文件中的内容写到 city.xml 文件中，如下\n所示：\n\n```\n    \u003c?xmlversion=\"1.0\" encoding=\"UTF-8\"?\u003e\n    \u003croot\u003e\n    \u003ccities\u003e\n    \u003c!-- \n    \t城市信息\n    --\u003e\n    {\n    \t\"1\" : \"上海\",\n    \t\"2\" : \"北京\",\n    \t\"3\" : \"成都\"\n    }\n    \u003c/cities\u003e\n    \u003c/root\u003e\n```\n\n**第 0019 题：** 将 第 0016 题中的 numbers.xls 文件中的内容写到 numbers.xml 文件中，如下\n\n所示：\n\n    \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n    \u003croot\u003e\n    \u003cnumbers\u003e\n    \u003c!-- \n    \t数字信息\n    --\u003e\n    \n    [\n    \t[1, 82, 65535],\n    \t[20, 90, 13],\n    \t[26, 809, 1024]\n    ]\n    \n    \u003c/numbers\u003e\n    \u003c/root\u003e\n\n**第 0020 题：** [登陆中国联通网上营业厅](http://iservice.10010.com/index_.html) 后选择「自助服务」 --\u003e 「详单查询」，然后选择你要查询的时间段，点击「查询」按钮，查询结果页面的最下方，点击「导出」，就会生成类似于 2014年10月01日～2014年10月31日通话详单.xls 文件。写代码，对每月通话时间做个统计。\n\n**第 0021 题：** 通常，登陆某个网站或者 APP，需要使用用户名和密码。密码是如何加密后存储起来的呢？请使用 Python 对密码加密。\n\n- 阅读资料 [用户密码的存储与 Python 示例](http://zhuoqiang.me/password-storage-and-python-example.html)\n\n- 阅读资料 [Hashing Strings with Python](http://www.pythoncentral.io/hashing-strings-with-python/)\n\n- 阅读资料 [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)\n\n**第 0022 题：** iPhone 6、iPhone 6 Plus 早已上市开卖。请查看你写得 第 0005 题的代码是否可以复用。\n\n**第 0023 题：** 使用 Python 的 Web 框架，做一个 Web 版本 留言簿 应用。\n\n[阅读资料：Python 有哪些 Web 框架](http://v2ex.com/t/151643#reply53)\n\n- ![留言簿参考](http://i.imgur.com/VIyCZ0i.jpg)\n\n\n**第 0024 题：** 使用 Python 的 Web 框架，做一个 Web 版本 TodoList 应用。\n\n- ![SpringSide 版TodoList](http://i.imgur.com/NEf7zHp.jpg)\n\n**第 0025 题：** 使用 Python 实现：对着电脑吼一声,自动打开浏览器中的默认网站。\n\n\n    例如，对着笔记本电脑吼一声“百度”，浏览器自动打开百度首页。\n    \n    关键字：Speech to Text\n    \n参考思路：    \n1：获取电脑录音--\u003eWAV文件\n    python record wav\n\n2：录音文件--\u003e文本\n\n    STT: Speech to Text\n    \n    STT API Google API\n\n3:文本--\u003e电脑命令\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyixiaohan%2Fshow-me-the-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyixiaohan%2Fshow-me-the-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyixiaohan%2Fshow-me-the-code/lists"}