Tài liệu Dive Into Python-Chapter 10 Scripts and Streams docx

Tài liệu Dive Into Python-Chapter 10. Scripts and Streams docx

Tài liệu Dive Into Python-Chapter 10. Scripts and Streams docx

... range(3): sys.stdout.write(&apos ;Dive in') 2 Dive inDive inDive in >>> for i in range(3): sys.stderr.write(&apos ;Dive in') 3 Dive inDive inDive in 1 As you saw in Example ... sock.close() return xmldoc 10. 2. Standard input, output, and error UNIX users are already familiar with the concept of standard input, standard output, and standard error....

Ngày tải lên: 26/01/2014, 08:20

49 377 0
Tài liệu Dive Into Python-Chapter 5. Objects and Object-Orientation ppt

Tài liệu Dive Into Python-Chapter 5. Objects and Object-Orientation ppt

... the same keys and values, and strings are equal when they are the same length and contain the same sequence of characters. For class instances, you can define the __cmp__ method and code the ... of elements. For class instances, define the __len__ method and code the length calculation yourself, and then call len(instance) and Python will call your __len__ special method f...

Ngày tải lên: 14/12/2013, 14:15

32 365 0
Tài liệu Dive Into Python-Chapter 6. Exceptions and File Handling doc

Tài liệu Dive Into Python-Chapter 6. Exceptions and File Handling doc

... with for Loops Chapter 6. Exceptions and File Handling In this chapter, you will dive into exceptions, file objects, for loops, and the os and sys modules. If you've used exceptions ... file handling. 6.1. Handling Exceptions Like many other programming languages, Python has exception handling via try except blocks. Note Python uses try except to handle exceptio...

Ngày tải lên: 26/01/2014, 08:20

50 414 0
Tài liệu Dive Into Python-Chapter 4. The Power Of Introspection ppt

Tài liệu Dive Into Python-Chapter 4. The Power Of Introspection ppt

... Introducing and >>> 'a' and 'b' 'b' >>> '' and 'b' '' >>> 'a' and 'b' and 'c' ... to filter lists using the built-in filter function. 4.6. The Peculiar Nature of and and or In Python, and and or perform boolean logic as you would expect, but they do not r...

Ngày tải lên: 14/12/2013, 14:15

45 651 0
Tài liệu Dive Into Python-Chapter 7. Regular Expressions doc

Tài liệu Dive Into Python-Chapter 7. Regular Expressions doc

... (400, 100 less than 500). CI is 101 ; IC is not even a valid Roman numeral (because you can't subtract 1 directly from 100 ; you would need to write it as XCIX, for 10 less than 100 , then ... start with the highest: the thousands place. For numbers 100 0 and higher, the thousands are represented by a series of M characters. Example 7.3. Checking for Thousands >>>...

Ngày tải lên: 14/12/2013, 14:15

23 356 0
Tài liệu Dive Into Python-Chapter 9. XML docx

Tài liệu Dive Into Python-Chapter 9. XML docx

... a remote XML file ("http://diveintopython.org/kant.xml") - a filename of a local XML file ("~/diveintopython/common/py/kant.xml") - standard input ("-") - ... extends into the 128-255 range for characters like n-with-a-tilde-over-it (241), and u-with-two-dots-over- it (252). And unicode uses the same characters as 7-bit ASCII for 0 through 127, an...

Ngày tải lên: 14/12/2013, 14:15

22 408 0
Tài liệu Dive Into Python-Chapter 8. HTML Processing doc

Tài liệu Dive Into Python-Chapter 8. HTML Processing doc

... appendix/history.html download/diveintopython-html-5.0.zip download/diveintopython-pdf-5.0.zip download/diveintopython-word-5.0.zip download/diveintopython-text-5.0.zip download/diveintopython-html-flat-5.0.zip ... subclasses SGMLParser and provides all 8 essential handler methods: unknown_starttag, unknown_endtag, handle_charref, handle_entityref, handle_comment, handle_pi, handle_...

Ngày tải lên: 26/01/2014, 08:20

66 296 0
Tài liệu Dive Into Python-Chapter 11. HTTP Web Services doc

Tài liệu Dive Into Python-Chapter 11. HTTP Web Services doc

... urllib.urlopen('http://diveintomark.org/xml/atom.xml').read() connect: (diveintomark.org, 80) 2 send: ' GET /xml/atom.xml HTTP/1.0 3 Host: diveintomark.org 4 User-agent: Python-urllib/1.15 ... opener.open(request).read() 3 connect: (diveintomark.org, 80) send: ' GET /xml/atom.xml HTTP/1.0 Host: diveintomark.org User-agent: OpenAnything/1.0 +http://diveintopython....

Ngày tải lên: 26/01/2014, 08:20

60 364 0
w