文档章节

Learn Python The Hard Way(22、23)

嚣张乾坤
 嚣张乾坤
发布于 2015/04/17 13:46
字数 562
阅读 7
收藏 0

There won't be any code in this exercise or the next one, so there's no WYSS or Extra Credit either. In fact, this exercise is like one giant Extra Credit. I'm going to have you do a form of review what you have learned so far.

First, go back through every exercise you have done so far and write down every word and symbol (another name for 'character') that you have used. Make sure your list of symbols is complete. Next to each word or symbol, write its name and what it does. If you can't find a name for a symbol in this book, then look for it online. If you do not know what a word or symbol does, then go read about it again and try using it in some code. You may run into a few things you just can't find out or know, so just keep those on the list and be ready to look them up when you find them.

What You are Learning

It's important when you are doing a boring mindless memorization exercise like this to know why. It helps you focus on a goal and know the purpose of all your efforts. In this exercise you are learning the names of symbols so that you can read source code more easily. It's similar to learning the alphabet and basic words of English, except this Python alphabet has extra symbols you might not know. Just take it slow and do not hurt your brain. Hopefully by now these symbols are natural for you so this isn't a big effort. It's best to take 15 minutes at a time with your list and then take a break. Giving your brain a rest will help you learn faster with less frustration.

-------------------------------------------------------------------------------------------------------------------

You should have spent last week getting your list of symbols straight and locked in your mind. Now you get to apply this to another week reading code on the internet.

This exercise will be daunting at first. I'm going to throw you in the deep end for a few days and have you just try your best to read and understand some source code from real projects. The goal isn't to get you to understand code, but to teach you the following three skills:

        1. Finding Python source code for things you need.

        2. Reading through the code and looking for files.

        3. Trying to understand code you find.


Here's what you do:

1. Go to bitbucket.org with your favorite web browser and search for "python".

2. Pick a random project and click on it.

3. Click on the Source tab and browse through the list of files and directories until you find a .py file (but not         setup.py, that's useless).

4. Start at the top and read through it, taking notes on what you think it does.

5. If any symbols or strange words seem to interest you, write them down to research later.

That's it. Your job is to use what you know so far and see if you can read the code

and get a grasp of what it does. Try skimming the code first, and then read it in

detail. Maybe also try taking very difficult parts and reading each symbol you know

outloud.




© 著作权归作者所有

嚣张乾坤
粉丝 12
博文 72
码字总数 24949
作品 0
海淀
高级程序员
私信 提问
25 本免费的 Python 编程电子书

全英文哦! Think Stats Dive Into Python A Byte Of Python Think Complexity Dive Into Python 3 DJANGO TUTORIAL Building Skills In OOP Pyramid For Humans Flask Microframework Build......

小编辑
2013/06/14
2.4K
6
如何在python3.3中调用刚存的文件

才开始学习python,用的是3.3.2版本。按照《Learn Python the Hard Way》在IDLE操作,保存ex1.py后,按照书中命令“python ex1.py”操作,出现: >>> python ex1.py SyntaxError: invalid s...

九天云霄
2013/10/13
487
2
无法理解有关Python字典/hash的一段代码

我正在用Learn Python The Hard Way(笨方法学Python)入门Python,这也是我学习编程的第一个语言。今天遇到一个问题,查了很久的谷歌还是无法解决。 链接在这里: http://learnpythonthehar...

好好先生_1028
2015/06/29
440
2
为什么Python教程不建议使用IDLE?

这个对能力的培养有什么影响吗? 常见问题回答 我可不可以使用 IDLE? 不行。你应该使用 OSX 的 Terminal 或者 Windows 的 Powershell,和我这里演示的一样。如果你不知道如何使用它们,你可...

scroll
2013/01/12
81K
17
学习 Python 的最佳方式

作者 | GENEVIEVE CARLTON 译者 | 姜松浩 责编 | 屠敏 出品 | CSDN(ID:CSDNNews) 以下为译文: 如今想要学习 Python 的人拥有比以往更多的资源。但是,这也可能使筛选书籍、课程和其他 Py...

CSDN资讯
03/14
0
0

没有更多内容

加载失败,请刷新页面

加载更多

spring cloud

一、从面试题入手 1.1、什么事微服务 1.2、微服务之间如何独立通讯的 1.3、springCloud和Dubbo有哪些区别 1.通信机制:DUbbo基于RPC远程过程调用;微服务cloud基于http restFUL API 1.4、spr...

榴莲黑芝麻糊
48分钟前
2
0
Executor线程池原理与源码解读

线程池为线程生命周期的开销和资源不足问题提供了解决方 案。通过对多个任务重用线程,线程创建的开销被分摊到了多个任务上。 线程实现方式 Thread、Runnable、Callable //实现Runnable接口的...

小强的进阶之路
昨天
6
0
maven 环境隔离

解决问题 即 在 resource 文件夹下面 ,新增对应的资源配置文件夹,对应 开发,测试,生产的不同的配置内容 <resources> <resource> <directory>src/main/resources.${deplo......

之渊
昨天
8
0
详解箭头函数和普通函数的区别以及箭头函数的注意事项、不适用场景

箭头函数是ES6的API,相信很多人都知道,因为其语法上相对于普通函数更简洁,深受大家的喜爱。就是这种我们日常开发中一直在使用的API,大部分同学却对它的了解程度还是不够深... 普通函数和...

OBKoro1
昨天
7
0
轻量级 HTTP(s) 代理 TinyProxy

CentOS 下安装 TinyProxy yum install -y tinyproxy 启动、停止、重启 # 启动service tinyproxy start# 停止service tinyproxy stop# 重启service tinyproxy restart 相关配置 默认...

Anoyi
昨天
2
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部