Dive Into Python 3 pptx
... ② ['c:\\Users\\pilgrim\\diveintopython3\\examples\\feed-broken.xml', 'c:\\Users\\pilgrim\\diveintopython3\\examples\\feed-ns0.xml', 'c:\\Users\\pilgrim\\diveintopython3\\examples\\feed.xml'] 1. ... NEW IN DIVE INTO PYTHON 3 ❝ Isn’t this where we came in? ❞ — Pink Floyd, The Wall -1.1. A.K.A. “THE MINUS LEVEL” Are you already a Python programmer? Did you...
Ngày tải lên: 08/03/2014, 22:20
Dive Into Python-Chapter 3. Native Datatypes
... for Python lists. A list in Python is like an array in Perl. In Perl, variables that store arrays always start with the @ character; in Python, variables can be named anything, and Python ... precision, and zero-padding. 3. 6. Mapping Lists One of the most powerful features of Python is the list comprehension, which provides a compact way of mapping a list into another lis...
Ngày tải lên: 07/11/2013, 10:15
Dive Into Python pptx
... installed.) Unpacking python2 .3 (from /python2 .3_ 2 .3. 1−1_i386.deb) Selecting previously deselected package python. Unpacking python (from /python_ 2 .3. 1−1_all.deb) Setting up python (2 .3. 1−1) Setting up python2 .3 ... [press Ctrl+D to exit] [root@localhost root]# python2 .3 Dive Into Python 5 Python 2 .3 (#1, Sep 12 20 03, 10: 53: 56) [GCC 3. 2.2 20 030 222 (...
Ngày tải lên: 28/03/2014, 23:20
... Double-click the installer. If you download PyXML 0.8 .3 for Windows and Python 2 .3, the installer program will be PyXML-0.8 .3. win32- py2 .3. exe. 4. Step through the installer program. ... and route requests between several unrelated services. It's like dividing Python modules into packages. 3 You're creating the SOAPProxy with the service URL and the service...
Ngày tải lên: 17/10/2013, 19:15
Dive Into Python-Chapter 13. Unit Testing
... 'MMMCCL'), (33 13, 'MMMCCCXIII'), (34 08, 'MMMCDVIII'), (35 01, 'MMMDI'), (36 10, 'MMMDCX'), (37 43, 'MMMDCCXLIII'), (38 44, 'MMMDCCCXLIV'), ... 'MMMCCL'), (33 13, 'MMMCCCXIII'), (34 08, 'MMMCDVIII'), (35 01, 'MMMDI'), (36 10, 'MMMDCX'), (37 43, 'M...
Ngày tải lên: 20/10/2013, 10:15
Dive Into Python-Chapter 14. Test-First Programming
... "C:\docbook\dip\py\roman\stage3\romantest3.py", line 133 , in testMalformedAntecedent self.assertRaises(roman3.InvalidRomanNumeralError, roman3.fromRoman, s) File "c: \python2 1\lib\unittest.py", ... "C:\docbook\dip\py\roman\stage3\romantest3.py", line 127, in testRepeatedPairs self.assertRaises(roman3.InvalidRomanNumeralError, roman3.fromRoman, s) Fi...
Ngày tải lên: 20/10/2013, 10:15
Dive Into Python-Chapter 15. Refactoring
... InvalidRomanNumeralError Ran 13 tests in 2.864s FAILED (failures=1) # or 500-800 (D, followed by 0 to 3 C's) (XC|XL|L?X{0 ,3} ) # tens - 90 (XC), 40 (XL), 0 -30 (0 to 3 X's), # or 50-80 ... X's), # or 50-80 (L, followed by 0 to 3 X's) (IX|IV|V?I{0 ,3} ) # ones - 9 (IX), 4 (IV), 0 -3 (0 to 3 I's), # or 5-8 (V, followed by 0 to 3 I's...
Ngày tải lên: 24/10/2013, 09:15
Dive Into Python-Chapter 16. Functional Programming
... py]$ python /home/you/diveintopython/common/py/fullpath.py 1 sys.argv[0] = /home/you/diveintopython/common/py/fullpath.py path = /home/you/diveintopython/common/py full path = /home/you/diveintopython/common/py ... /home/you/diveintopython/common/py [you@localhost diveintopython]$ python common/py/fullpath.py 2 sys.argv[0] = common/py/fullpath.py path = common/py full path = /home...
Ngày tải lên: 24/10/2013, 09:15
Dive Into Python-Chapter 17. Dynamic functions
... Generators in for loops >>> for n in fibonacci(1000): 1 print n, 2 0 1 1 2 3 5 8 13 21 34 55 89 144 233 37 7 610 987 1 You can use a generator like fibonacci in a for loop directly. The ... 'vacancies' 1 This regular expression turns vacancy into vacancies and agency into agencies, which is what you wanted. Note that it would also turn boy into boi...
Ngày tải lên: 28/10/2013, 16:15
Dive Into Python-Chapter 18. Performance Tuning
... "D": " ;3& quot;, "import soundex") 1 >>> t.timeit() 2 8.216 837 335 47 >>> t.repeat (3, 2000000) 3 [16.4 831 930 9109, 16.461289849 23, 16.442 039 48912] 1 The ... 14.4 033 3 534 01 Flingjingwaller F452 19.77748820 03 The first thing to consider is replacing that regular expression with a loop. This code is from soundex/stage4/sounde...
Ngày tải lên: 28/10/2013, 16:15