资源描述:
《Programming Python Fourth Edition》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、ProgrammingPythonFOURTHEDITIONProgrammingPythonMarkLutzBeijing•Cambridge•Farnham•Köln•Sebastopol•TokyoProgrammingPython,FourthEditionbyMarkLutzCopyright©2011MarkLutz.Allrightsreserved.PrintedintheUnitedStatesofAmerica.PublishedbyO’ReillyMedia,Inc.,1005Gravens
2、teinHighwayNorth,Sebastopol,CA95472.O’Reillybooksmaybepurchasedforeducational,business,orsalespromotionaluse.Onlineeditionsarealsoavailableformosttitles(http://my.safaribooksonline.com).Formoreinformation,contactourcorporate/institutionalsalesdepartment:(800)
3、998-9938orcorporate@oreilly.com.Editor:JulieSteeleIndexer:LucieHaskinsProductionEditor:TeresaElseyCoverDesigner:KarenMontgomeryProofreader:TeresaElseyInteriorDesigner:DavidFutatoIllustrator:RobertRomanoPrintingHistory:October1996:FirstEdition.March2001:Second
4、Edition.August2006:ThirdEdition.December2010:FourthEdition.NutshellHandbook,theNutshellHandbooklogo,andtheO’ReillylogoareregisteredtrademarksofO’ReillyMedia,Inc.ProgrammingPython,theimageofanAfricanrockpython,andrelatedtradedressaretrademarksofO’ReillyMedia,I
5、nc.Manyofthedesignationsusedbymanufacturersandsellerstodistinguishtheirproductsareclaimedastrademarks.Wherethosedesignationsappearinthisbook,andO’ReillyMedia,Inc.,wasawareofatrademarkclaim,thedesignationshavebeenprintedincapsorinitialcaps.Whileeveryprecaution
6、hasbeentakeninthepreparationofthisbook,thepublisherandauthorassumenoresponsibilityforerrorsoromissions,orfordamagesresultingfromtheuseoftheinformationcon-tainedherein.ISBN:978-0-596-15810-1[QG]1292258056TableofContentsPreface..................................
7、.................................xxiiiPartI.TheBeginning1.ASneakPreview........................................................3“ProgrammingPython:TheShortStory”3TheTask4Step1:RepresentingRecords4UsingLists4UsingDictionaries9Step2:StoringRecordsPersistently14
8、UsingFormattedFiles14UsingPickleFiles19UsingPer-RecordPickleFiles22UsingShelves23Step3:SteppingUptoOOP26UsingClasses27AddingBehavior29AddingInheritance29RefactoringCode31AddingPersistence