Dive Into Python-Chapter 15 Refactoring

Dive Into Python-Chapter 15. Refactoring

Dive Into Python-Chapter 15. Refactoring

... Chapter 15. Refactoring 15. 1. Handling bugs Despite your best efforts to write comprehensive unit tests, bugs happen. ... 'MCDLXXXV'), (150 9, 'MDIX'), (1607, 'MDCVII'), (1754, 'MDCCLIV'), (1832, 'MDCCCXXXII'), (1993, 'MCMXCIII'), (2074, 'MMLXXIV'), ( 2152 , 'MMCLII'), ... and before fixing it, you should wri...

Ngày tải lên: 24/10/2013, 09:15

49 269 0
Dive Into Python-Chapter 12. SOAP Web Services

Dive Into Python-Chapter 12. SOAP Web Services

... Certified Open Source: Pythonline http://www.pythonline.com/ Dive Into <b>Python</b> http://diveintopython.org/ Dive Into <b>Python</b>. <b>Python</b> from ... sample output for a search for the word “python”. Example 12.2. Sample Usage of search.py C:\diveintopython\common\py> python search.py "python" <b>Python</b> Program...

Ngày tải lên: 17/10/2013, 19:15

51 392 0
Dive Into Python-Chapter 13. Unit Testing

Dive Into Python-Chapter 13. Unit Testing

... 'MCDLXXXV'), (150 9, 'MDIX'), (1607, 'MDCVII'), (1754, 'MDCCLIV'), (1832, 'MDCCCXXXII'), (1993, 'MCMXCIII'), (2074, 'MMLXXIV'), ( 2152 , 'MMCLII'), ... 'MCDLXXXV'), (150 9, 'MDIX'), (1607, 'MDCVII'), (1754, 'MDCCLIV'), (1832, 'MDCCCXXXII'), (1993, 'MCMXCIII&ap...

Ngày tải lên: 20/10/2013, 10:15

19 397 1
Dive Into Python-Chapter 14. Test-First Programming

Dive Into Python-Chapter 14. Test-First Programming

... Traceback (most recent call last): File "C:\docbook\dip\py\roman\stage1\romantest1.py", line 154 , in testFromRomanCase roman1.fromRoman(numeral.upper()) AttributeError: 'None' object ... Traceback (most recent call last): File "C:\docbook\dip\py\roman\stage2\romantest2.py", line 156 , in testFromRomanCase roman2.fromRoman, numeral.lower()) File "c:\python...

Ngày tải lên: 20/10/2013, 10:15

53 365 0
Dive Into Python-Chapter 16. Functional Programming

Dive Into Python-Chapter 16. Functional Programming

... sys.argv[0] = /home/you/diveintopython/common/py/fullpath.py path = /home/you/diveintopython/common/py full path = /home/you/diveintopython/common/py [you@localhost diveintopython]$ python common/py/fullpath.py ... /home/you/diveintopython/common/py [you@localhost diveintopython]$ cd common/py [you@localhost py]$ python fullpath.py 3 sys.argv[0] = fullpath.py path = full path = /home/you/dive...

Ngày tải lên: 24/10/2013, 09:15

36 301 0
Dive Into Python-Chapter 17. Dynamic functions

Dive Into Python-Chapter 17. Dynamic functions

... '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 boies, but that will never happen in the ... and quickly descends into more advanced uses. English is a schizophrenic language that borrows from a lot of other languages, and the rules for making singular noun...

Ngày tải lên: 28/10/2013, 16:15

36 344 0
Dive Into Python-Chapter 18. Performance Tuning

Dive Into Python-Chapter 18. Performance Tuning

... C:\samples\soundex\stage4>python soundex4a.py Woo W000 6.62865531792 Pilgrim P426 9.0224757 6158 Flingjingwaller F452 13.6328416042 But wait a minute. A loop to remove characters from a ... one more thing you can do to these three lines of code to make them faster: you can combine them into one line. Take a look at soundex/stage4/soundex4d.py: return (digits2.replace('9...

Ngày tải lên: 28/10/2013, 16:15

46 444 0
Dive Into Python-Chapter 1. Installing Python

Dive Into Python-Chapter 1. Installing Python

... Chapter 1. Installing Python Welcome to Python. Let's dive in. In this chapter, you'll install the version of Python that's right for you. ... that scripts are running under the latest version of Python, and be sure to type python2.3 to get into the interactive shell. 1.6. Python on Debian GNU/Linux If you are lucky enough to be running ... calculator! Launch the Pyt...

Ngày tải lên: 07/11/2013, 10:15

20 332 0
Dive Into Python-Chapter 2. Your First Python

Dive Into Python-Chapter 2. Your First Python

... files. Some, like the sys module, are "built-in modules"; they are actually baked right into Python itself. Built-in modules behave just like regular modules, but their Python source ... suite is ignored. This makes it easier to develop and debug new modules before integrating them into a larger program. On MacPython, there is an additional step to make the if __name__ tr...

Ngày tải lên: 07/11/2013, 10:15

17 361 0
Dive Into Python-Chapter 3. Native Datatypes

Dive Into Python-Chapter 3. Native Datatypes

... values through string formatting  Mapping lists into other lists using list comprehensions  Splitting strings into lists and joining lists into strings is an important distinction that ... list of key-value pairs in the form key=value, and you want to join them into a single string. To join any list of strings into a single string, use the join method of a string object. H...

Ngày tải lên: 07/11/2013, 10:15

46 279 0
w