`
sillycat
  • 浏览: 2486887 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

English-014 DiveintoPython

阅读更多
English-014 DiveintoPython

1.There is an alternative form of string formatting that uses dictionaries instead of tuples of values.
alternative [ɔ:l'tə:nətiv]   adj. 供选择的;选择性的;交替的 n. 二中择一;供替代的选择

2.This name is used as a key in the params dictionary and substitutes the corresponding value, secret, in place of the %(pwd)s marker.
substitute ['sʌbstitju:t, -tu:t]  n. 代替者;代用品 vi. 替代 vt. 代替

3.At this point, it's worth digging a little further into SGMLParser. I've claimed repeatedly (and you've taken it on faith so far) that SGMLParser looks for and calls specific methods for each tag, if they exist. For instance, you just saw the definition of start_pre and end_pre to handle <pre> and </pre>. But how does this happen? Well, it's not magic, it's just good Python coding.
dig [diɡ]   vt. 挖,掘;探究

4.Hey, wait a minute, there's an import statement in this function! That's perfectly legal in Python.

5. It would be helpful if you already knew what an XML document looks like, that it's made up of structured tags to form a hierarchy of elements, and so on. If this doesn't make sense to you, there are many XML tutorials that can explain the basics.
hierarchy ['haiə,rɑ:ki]  n. 层级;等级制度

6.This is, of course, complete gibberish. Well, not complete gibberish. It is syntactically and grammatically correct.
gibberish ['dʒibəriʃ]   n. 快速而不清楚的言语;乱语
syntactic [sin'tæktik]  adj. 句法的;语法的;依据造句法的

7.Actually parsing an XML document is very simple: one line of code. However, before you get to that line of code, you need to take a short detour to talk about packages.
detour ['di:,tuə, di'tuə]  vt. 使…绕道而行 n. 便道;绕道

8.Here you're importing a module (minidom) from a nested package (xml.dom)
nested ['nestid]   adj. 嵌套的,内装的

9.If you ever find yourself writing a large subsystem in Python (or, more likely, when you realize that your small subsystem has grown into a large one), invest some time designing a good package architecture. It's one of the many things Python is good at, so take advantage of it.
take advantage of  利用

10.Since getting the first child node of a node is a useful and common activity, the Node class has a firstChild attribute, which is synonymous with childNodes[0]. (There is also a lastChild attribute, which is synonymous with childNodes[-1].)
synonymous [si'nɔniməs]  adj. 同义的;同义词的;同义突变的
anonymous [ə'nɔniməs] adj. 匿名的,无名的;无个性特征的

11.Drilling down all the way to text
drill down  向地下钻;深度探讨  drill [dril]  n. 钻子;钻孔机;播种机;训练 vi. 钻孔;训练

12.you would need to store the character encoding alongside each piece of text, and make sure to pass it around whenever you passed the text around.
alongside [ə'lɔŋ'said]  adv. 在旁边 prep. 在……旁边

13.Traversing XML documents by stepping through each node can be tedious.
tedious ['ti:dʒəs]  adj. 冗长乏味的;沉闷的
traverse ['trævəs, -və:s, trə'və:s, træ-]  n. 横木;横贯;穿过

14.Searching is actually recursive
recursive [ri'kə:siv]  adj. [计]递归的;循环的

15.XML elements can have one or more attributes, and it is incredibly simple to access them once you have parsed an XML document.

16.This section may be a little confusing, because of some overlapping terminology.
overlapping [,əuvə'læpiŋ]  adj. 重叠;覆盖
terminology [tə:mi'nɔlədʒi]  n. 术语,术语学;用辞

17.When called with a size parameter, it reads that much from the input source and returns that much data; when called again, it picks up where it left off and returns the next chunk of data.
chunk [tʃʌŋk]  n. 大块;矮胖的人或物

18.In case you were wondering how this relates to XML processing, minidom.parse is one such function which can take a file-like object.

19.Well, that all seems like a colossal waste of time. After all, you've already seen that minidom.parse can simply take the filename and do all the opening and closing nonsense automatically.
colossal [kə'lɔsəl]   adj. 巨大的;异常的,非常的

20.Now you pass the file-like object to minidom.parse, which obediently calls the read method of the object and parses the XML data that the read method returns. The fact that this XML data is now coming straight from a web page is completely irrelevant. minidom.parse doesn't know about web pages, and it doesn't care about web pages; it just knows about file-like objects.
obediently [əu'bi:diəntli]  adv. 顺从地;服从地;忠顺地
irrelevant [i'reləvənt]   adj. 不切题的;不相干的
relevant ['reləvənt]  adj. 有关的;中肯的;有重大作用的

分享到:
评论

相关推荐

    Dive into python (英文)

    Dive into python, English version

    Test-Driven Development with Python [2017]

    Dive into the TDD workflow, including the unit test/code cycle and refactoring Use unit tests for classes and functions, and functional tests for user interactions within the browser Learn when and ...

    MQTT Essentials - A Lightweight IoT Protocol

    Dive deep into one of IoT's extremely lightweight machines to enable connectivity protocol with some real-world examples Learn to take advantage of the features included in MQTT for IoT and Machine-to...

    Large Scale Machine Learning with Python

    Dive into scalable machine learning and the three forms of scalability. Speed up algorithms that can be used on a desktop computer with tips on parallelization and memory allocation. Get to grips with...

    Python Data Analysis Cookbook

    In this book, you will dive deeper into recipes on spectral analysis, smoothing, and bootstrapping methods. Moving on, you will learn to rank stocks and check market efficiency, then work with metrics...

    Python Deep Learning

    Whether you want to dive deeper into Deep Learning, or want to investigate how to get more out of this powerful technology, you’ll find everything inside. What you will learn Get a practical deep ...

    LargeScaleMachineLearningwithPython.pdf

    Large Scale Machine Learning with Python [PDF + EPUB + CODE] Packt Publishing | August 4, 2016 | English | 439 pages Large Python machine learning projects involve new problems associated with ...

    Hands-On Machine Learning with Scikit-Learn and TensorFlow [EPUB]

    decision trees, random forests, and ensemble methods Use the TensorFlow library to build and train neural nets Dive into neural net architectures, including convolutional nets, recurrent nets, and ...

    Hands-On Machine Learning with Scikit-Learn and TensorFlow [Kindle Edition]

    Dive into neural net architectures, including convolutional nets, recurrent nets, and deep reinforcement learning Learn techniques for training and scaling deep neural nets Apply practical code ...

    Machine.Learning.in.Python

    The chapters on penalized linear regression and ensemble methods dive deep into each of the algorithms, and you can use the sample code in the book to develop your own data analysis solutions. ...

    Machine Learning in Python 无水印pdf 0分

    The chapters on penalized linear regression and ensemble methods dive deep into each of the algorithms, and you can use the sample code in the book to develop your own data analysis solutions....

    Python Machine Learning By Example [2017].azw3电子书下载

    Dive deep into the world of analytics to predict situations correctly Implement machine learning classification and regression algorithms from scratch in Python Be amazed to see the algorithms in ...

    Advanced Analytics with Spark: Patterns for Learning from Data at Scale

    You’ll start with an introduction to Spark and its ecosystem, and then dive into patterns that apply common techniques—including classification, clustering, collaborative filtering, and anomaly ...

    Building Recommendation Engines

    Dive into the various techniques of recommender systems such as collaborative, content-based, and cross-recommendations Create efficient decision-making systems that will ease your work Familiarize ...

    Raspberry Pi Zero Cookbook

    Deep dive into the components of the small yet powerful Raspberry Pi Zero Get into grips with integrating various hardware, programming, and networking concepts with the so-called “cheapest computer...

    Packt.Django.Project.Blueprints.2016

    Dive deep into Django forms and how they work internally About the Author Asad Jibran Ahmed is an experienced programmer who has worked mostly with Django-based web applications for the past 5 years. ...

    React and React Native [Kindle Edition]

    Dive deep into each platform, from routing in React to creating native mobile applications that can run offline Use Facebook's Relay, React and GraphQL technologies, to create a unified architecture ...

Global site tag (gtag.js) - Google Analytics