首页 复件 Introduction to Python Programming and Devel…

复件 Introduction to Python Programming and Developing GUI Applications.pdf

复件 Introduction to Python Progr…

上传者: ttttttttt 2013-02-17 评分1 评论0 下载298 收藏0 阅读量748 暂无简介 简介 举报

简介:本文档为《复件 Introduction to Python Programming and Developing GUI Applicationspdf》,可适用于IT书籍领域,主题内容包含CopyrightIntroductiontoPythonProgrammingandDevelopingGUIApplicationswithPy符等。

CopyrightIntroductiontoPythonProgrammingandDevelopingGUIApplicationswithPyQTBMHarwaniPublisherandGeneralManager,CourseTechnologyPTR:StacyLHiquetAssociateDirectorofMarketing:SarahPanellaManagerofEditorialServices:HeatherTalbotMarketingManager:MarkHughesSeniorAcquisitionsEditor:MitziKoontzProjectEditor:KimBenbowTechnicalReviewer:KeithDavenportCopyEditor:GeneReddingInteriorLayout:MPSLimited,aMacmillanCompanyCoverDesigner:MikeTanamachiIndexer:BIMIndexingServicesProofreader:BradCrawfordCourseTechnology,apartofCengageLearningALLRIGHTSRESERVEDNopartofthisworkcoveredbythecopyrighthereinmaybereproduced,transmitted,stored,orusedinanyformorbyanymeansgraphic,electronic,ormechanical,includingbutnotlimitedtophotocopying,recording,scanning,digitizing,taping,Webdistribution,informationnetworks,orinformationstorageandretrievalsystems,exceptaspermittedunderSectionoroftheUnitedStatesCopyrightAct,withoutthepriorwrittenpermissionofthepublisherForproductinformationandtechnologyassistance,contactusatCengageLearningCustomerSalesSupport,Forpermissiontousematerialfromthistextorproduct,submitallrequestsonlineatwwwcengagecompermissionsFurtherpermissionsquestionscanbeemailedtopermissionrequestcengagecomPythonandthePythonlogosaretrademarksorregisteredtrademarksofthePythonSoftwareFoundationAllothertrademarksarethepropertyoftheirrespectiveownersAllimagesCengageLearningunlessotherwisenotedLibraryofCongressControlNumber:ISBN:ISBN:eISBN:CourseTechnology,apartofCengageLearningChannelCenterStreetBoston,MAUSACengageLearningisaleadingproviderofcustomizedlearningsolutionswithofficelocationsaroundtheglobe,includingSingapore,theUnitedKingdom,Australia,Mexico,Brazil,andJapanLocateyourlocalofficeat:internationalcengagecomregionCengageLearningproductsarerepresentedinCanadabyNelsonEducation,LtdForyourlifelonglearningsolutions,visitcourseptrcomVisitourcorporatewebsiteatcengagecomPrintedintheUnitedStatesofAmericaDedicationThisbookisdedicatedtomymother,MrsNitaHarwani,andAmericaninventorandentrepreneur,thelateSteveJobsMymotherisnexttoGodforme,andwhateverIamtodayisbecauseofthemoralvaluestaughtbyherSteveJobs,cofounder,chairman,andchiefexecutiveofficerofAppleInchasbeenandwillalwaysbeagreatinspirationformeAcknowledgmentsIoweadebtofgratitudetoMitziKoontz,SeniorAcquisitionsEditoratCourseTechnology,CengageLearningforherinitialacceptanceandgivingmeanopportunitytocreatethisworkIamhighlygratefultothewholeteamatCengagefortheirconstantcooperationandcontributiontocreatethisbookImustthankKeithDavenport,thetechnicaleditorforhisexcellent,detailedreviewoftheworkandthemanyhelpfulcommentsandsuggestionshemadeHeofferedasignificantamountoffeedbackthathelpedtoimprovethebook’scontentHeplayedavitalroleinimprovingitsstructureandthequalityofinformationSpecialthankstoGeneRedding,thecopyeditorforfirstclassstructuralandlanguageeditingIappreciatehiseffortsinenhancingthecontentsofthebookandgivingitapolishedlookBigandongoingthankstoKimBenbow,myprojecteditor,fordoingagreatjobandhersincereeffortstogetthebookpublishedontimeAgreatbigthankyougoestotheproductionstaffwhoworkedtirelesslytoproducethisbookIenjoyedworkingwitheachofyouIamalsothankfultomyfamily(mysmallworld):Anushka(mywife)andmytwolittledarlings,ChiragandNaman,foralwaysinspiringmeandgivingmethecouragetoworkharderIshouldnotforgettothankmydearstudentswhohavebeengoodteachersforme,astheyhelpmetounderstandthebasicproblemstheyfacewithasubject,whichenablesmetodirectlyteachthosetopicsTheirendlesslyinterestingquerieshelpmetowritebookswithapracticalapproachAbouttheAuthorBMHarwaniisfounderandownerofMicrochipComputerEducation(MCE),basedinAjmer,India,whichprovidescomputereducationonallprogrammingandwebdevelopingplatformsHarwanigraduatedwithaBEincomputerengineeringfromtheUniversityofPune,andalsohasaCLevel(master’sdegree)incomputertechnologyfromDOEACC,GovernmentofIndiaBeinginvolvedintheteachingfieldforoveryears,hehasdevelopedtheartofexplainingeventhemostcomplicatedtechnicaltopicsinastraightforwardandeasilyunderstandablefashionHehaswrittenseveralbooksonvarioussubjectsthatincludeJSP,JSF,EJB,PHP,NET,Joomla,jQuery,andsmartphonesHislatestbooksincludeBeginningWebDevelopmentforSmartphones(Shroff,),CoreDataiOSEssentials(PacktPublishing,)andBloggingwithWordPressforBeginners(CreateSpace,)Healsowritesarticlesonavarietyofcomputersubjects,whichcanbeseenonanumberofwebsitesTofindoutmore,visithisblogathttp:bmharwanicomblogCopyrightAcknowledgmentsAbouttheAuthorContensIntrductionChapterPythonandItsFeaturesPythonInstallingPythonInteractingwithPythonWritingYourFirstPythonProgramDataTypesinPythonBasicElementsinaProgramCommentsContinuationLinesPrintingSummaryChapterGettingWetinPythonPerformingArithmeticOperationsBitwiseOperationsComplexNumbersMakingDecisionsTableofContentsLogicalOperatorsChainingComparisonOperatorsLoopsSummaryChapterSequencesSequencesStringsListsTuplesSetsSummaryChapterFunctionsandModulesFunctionsFunctionAttributesRecursionIteratorsModulesSummaryChapterClassesTheClassStatementClassMethodsStaticMethodsGarbageCollectionInheritanceMultilevelInheritanceOperatorOverloadingDescriptorsSummaryChapterFileHandlingExceptionHandlingRaisinganExceptionSummaryChapterPyQtQtToolkitPyQtInstallingPyQtWindowandDialogsCreatingaGUIApplicationwithCodeUsingQtDesignerUnderstandingFundamentalWidgetsEventHandlinginPyQtFirstApplicationinQtDesignerUsingCustomSlotsConvertingDataTypesDefiningBuddiesSummaryChapterBasicWidgetsUsingRadioButtonsUsingCheckboxesEnteringIntegerandFloatValuesUsingaSpinBoxScrollBarsandSlidersWorkingwithaListWidgetSummaryChapterAdvancedWidgetsDisplayingSystemClockTimeinLCDFormatWorkingwithCalendarandDisplayingDatesinDifferentFormatsUsingComboBoxDisplayingaTableDisplayingWebPagesDisplayingGraphicsSummaryChapterMenusandToolbarsUnderstandingMenusCreatingaToolbarDockWidgetTabWidgetConvertingaTabWidgetSummaryChapterMultipleDocumentsandLayoutsMultipleDocumentInterfaceLayoutsSummaryChapterDatabaseHandlingWhyMySQLCreatingaDatabaseDatabaseMaintenanceThroughConsoleBasedProgramsDatabaseMaintenanceThroughGUIProgramsSummaryIndexIntroductionPythonisaninterpreted,generalpurpose,highlevelprogramminglanguagethatisverypopularamongdevelopersandprofessionalsbecauseofitsvastlibraryofaddonmodulesItisaplatformindependentscriptedlanguagethatissupportedbymanyindividualsasanopensourceprojectThefactthatitisfreelyavailableandrunsonallplatformsmakesitevermorepopularThegoalofIntroductiontoPythonProgrammingandDevelopingGUIApplicationswithPyQTistoteachthePythonprogramminglanguagethroughpracticalexamplesWhetheryouarenewtocomputersorareanexperiencedprogrammer,thisbookisintendedtohelpyoudevelopyourprogrammingskillsItiswrittenwiththerequirementsofalllevelsinminddevelopers,professionals,andbeginnersThebookbeginswithasolidintroductionofPythonfromscratchloops,controlstructures,sequences,functions,classes,andexceptionhandlingThereafter,thebookexplainspersistencethroughfilehandlingandtargetsdevelopersbyintroducingGUIapplicationdevelopmentinPyQTAsyoureadthroughthebook,youwillacquiretheskillsneededforbuildingpracticalPythonprogrammingapplicationsandwilllearnhowtheseskillscanbeputintouseinrealworldscenariosLikeanygoodbook,IntroductiontoPythonProgrammingexplainsthemorebasicconcepts,onestepatatime,bywritingsmallprogramstodemonstrateeachstepGradually,oncethereaderisacquaintedwithlogicalblocks,thebookexplainsusingtheblocksforunderstandingmorecomplexconceptsBythetimeyoufinishthebook,youwillunderstandhowtobreakproblemsdownintomanageablechunks,andthenrefineyourcodeintoapplicationsHowThisBookisOrganizedThisbookstartswithadiscussionofPython’sbasics,beginningwitheasyexamples,andthengraduallygoingdeepertouncoverthemorecomplextopicsofGUIprogramminginPythonBytheendofthebook,readerswillalsohaveanunderstandingofusingbackenddatabasesforstoringandfetchinginformationChapter,“PythonanditsFeatures”:Inthischapter,youwillhaveadetailedintroductiontoPythonanditsfeatures,suchasinstallingPythonondifferentplatforms,interactingwithPythonthroughCommandLinemodeandtheIDLEIDEYouwillalsolearntowriteyourfirstPythonprogramThechapteralsointroducesthePythonbasics,likeitsdifferentdatatypes,literals,variables,andkeywordsFinally,thechapterexplainshowtowritecomments,continuationlines,andprintmessagesChapter,“GettingWetinPython”:Inthischapter,youwilllearntoapplyarithmeticoperationsanddifferentlogicalandmembershipoperatorsinPythonprogramsYouwillseetheuseofescapesequencesYouwilllearntogetdatafromtheuseraswellasprocessincomingdataYouwillalsoseehowtoconvertdataintodifferenttypes,learntodisplayoctalandhexavalues,performbitwiseoperations,andusecomplexnumbersYouwillalsolearnhowtousetheifelsestatementinmakingdecisionsFinally,thechapterexplainshowtousewhileandforloopsfordoingrepetitivetasksChapter,“Sequences”:ThischapterfocusesonusingdifferentcontainersYouwilllearntoperformdifferentoperationsonstrings,includingconcatenatingstrings,splittingstrings,andthenconvertingthemintodifferentcases,suchasuppercase,titlecase,andlowercase,etcAlso,youwilllearntodolistslicing,searchingelementsintuples,andperformingoperationsonsets,suchasfindingtheirunion,intersection,anddifferencesYouwilllearnhowkeyvaluepairsaremaintainedinadictionaryandhowtoappend,delete,orandmodifykeyvaluepairsFinally,thechapterexplainshowtocreateoneandtwodimensionalarraysChapter,“FunctionsandModules”:Inthischapter,youwilllearnaboutdifferentstatementsthatdefineandreturnvaluesfromfunctionsAlso,youwilllearntousedefaultvalueparametersandkeywordargumentsinafunction,aswellasuselocalandglobalvariablesThechapterexplainshowtocreatelambdafunctionsforsmallerexpressionsAlso,youwilllearnhowtoapplyfunctionstosequencesusingdifferentfunctionattributesandimplementrecursionForaccessingcollectionsofdata,thechapterexplainshowtouseiterators,generators,andgeneratorexpressionsYouwilllearntoimportandusemodulesforbuiltinfunctionsThechapteralsoexplainshowtopasscommandlineargumentstoaPythonprogramChapter,“Classes”:ThischapterfocusesonclassesYouwilllearnhowtodefineaclass,definefunctionsforit,initializeitsinstancevariables,anduseclassandstaticmethodsYouwillalsolearntouseclassattributestodisplayspecificinformationrelatedtotheclassYouwilllearntheconceptofgarbagecollectionanditsroleinfreeingupmemoryconsumedbyobjectsthatareoutofscopeAlso,youwilllearntoapplysingle,multilevel,andmultipleinheritancethroughrunningpracticalexamplesYouwilllearntheuseofprivateandpublicaccessspecifiersandhowtoapplymethodoverridingandoperatoroverloadingtoperformarithmeticoperationsoninstancesFinally,thechapterexplainspolymorphismandsettingandgettingvaluesofinstanceattributesthroughpropertiesanddescriptorsChapter,“FileHandling”:Inthischapter,youwilllearntoperformdifferentoperationsonfilesYouwilllearntoopenafileindifferentmodesandtoreaditscontents,updateexistingcontent,deletecontent,andappendnewcontentYouwillalsoseehowtocopyafile,readafilesequentiallyorrandomly,andreadonlyspecificcontentYouwilllearntocreateabinaryfileaswellaspickleandunpickleobjectsFinally,thechapterexplainshowtoimplementexceptionhandlingandtheprocedureforraisingexceptionsChapter,“PyQt”:Inthischapter,youwillbeintroducedtotheQttoolkit,QtDesigner,andPyQtYouwilllearnaboutdifferentQtDesignercomponents,suchasthetoolbar,theObjectInspector,thePropertyEditor,andtheWidgetBoxYouwillalsolearntocreateaGUIapplicationthroughcodingAlso,youwilllearnaboutthefundamentalLabel,LineEdit,andPushButtonwidgetsaswellaslearntodevelopapplicationsusingthemYouwillalsolearnaboutsignalslotconnectionintheQtDesignerandhowtoconnectsignalstobothpredefinedslotsandtocustomslotsChapter,“BasicWidgets”:ThischapterdemonstrateshowtocreateaGUIapplicationusingRadioButtons,whichenabletheusertoselectoneoptionoutofseveralYouwillalsolearnhowtoselectmorethanoneoptionbyusingCheckBoxesandspecifyintegersaswellasfloatvaluesusingSpinBoxesAlso,youwilllearntouseScrollBarsandSliderstodisplaylargedocumentsandrepresentintegervaluesFinally,thechapterexplainshowtodisplayoptionswithaListwidget,additemstoaListwidget,anddeleteandeditexistingitemsinaListwidgetChapter,“AdvancedWidgets”:ThischapterexplainshowtoaccessanddisplaysystemclocktimeinLCDdigitsYoualsowillseehowtodisplayacalendaranddisplayaselecteddateindifferentformatsYouwilllearntocreateanapplicationthatdisplaysoptionswithaComboBox,displaysinformationwithaTablewidget,displayswebpages,anddisplaysgraphicsChapter,“MenusandToolbars”:Inthischapter,youwilllearntocreatemenusandtoolbarsAlso,youwilllearnabouttheActionEditorandhowitcanhelpyoudefineactionsformenusandtoolbarsYouwillalsolearnhowtomanageapplicationresourcesinoneplacethrougharesourcefileYouwillseehowtocreatedockablewindowsandhowtodisplayinformationinsmallchunkswiththeTabwidgetFinally,thechapterexplainshowtoconvertaTabwidgetintoaToolBoxorStackedwidgetChapter,“MultipleDocumentsandLayouts”:Inthischapter,youwilllearntomanagemultipledocumentsinamainwindowthroughanMDIYouwillseehowchildwindowsinMdiAreacanbearrangedincascadingandtilefashionsYouwillalsolearntoplaceacollectionofwidgetsthatdosimilartasksinaGroupBoxYouwillalsolearntoorganizewidgetsindifferentlayoutsChapter,“DatabaseHandling”:Inthischapter,youwilllearntoinstallandusetheMySQLdbmodule,whichisrequiredinordertoaccesstheMySQLDatabaseServerthroughPythonAlso,youwilllearntomaintainadatabasethroughconsolebasedprogramsandthroughGUIprogramsYouwillalsolearntowritePythonscriptstoinsert,fetch,delete,search,andupdaterowsinadatabasetableCompanionWebsiteDownloadsYoumaydownloadthecompanionwebsitefilesfromwwwcourseptrcomdownloadsPleasenotethatyouwillberedirectedtotheCengageLearningwebsiteChapterPythonandItsFeaturesThischaptercoversthefollowing:IntroductiontoPythonanditsfeaturesInstallingPythonondifferentplatformsInteractingwithPythonthroughCommandLineModeandIDLEWritingYourFirstPythonProgramUnderstandingdatatypesandbasicelementsinPythonWritingcommentsandcontinuationlinesandprintingmessagesPythonPythonisaverypowerfulhighlevel,dynamicobjectorientedprogramminglanguagecreatedbyGuidovanRossuminItisimplementedinC,andreliesontheextensiveportableClibrariesItisacrossplatformlanguageandrunsonallmajorhardwareplatformsandoperatingsystems,includingWindows,LinuxUNIX,andMacintoshPythonhasaneasytousesyntaxandisquiteeasytolearn,makingitsuitableforthosewhoarestilllearningtoprogramPythonhasarichsetofsupportinglibraries,andmanythirdpartymodulesareavailableforitPythonisaprogramminglanguagethatalsosupportsscripting,makingitsuitableforrapidapplicationdevelopmentPythoncomeswithapowerfulandeasytousegraphicaluserinterface(GUI)toolkitthatmakesthetaskofdevelopingGUIapplicationsinPythonquiteeasyItisfreelyavailablePythonImplementationsPythoncurrentlyhasthreeimplementations,knownasCPython,Jython,andIronPythonInthisbook,youwillbeusingCPython,themostwidelyusedimplementation,whichIwillrefertoasjustPythonforsimplicityAsmalldescriptionofallthreeimplementationsisasfollows:CPythonClassicPython(oftenjustcalledPython)isthefastest,mostuptodate,andcompleteimplementationofPythonItisimplementedinC(ie,itslibrariesandmodulesareallcodedinstandardC)ItiscrossplatformandrunsonalmostallplatformsJythonJythonisaPythonimplementationthatisJavaVirtualMachine(JVM)compliantWithJython,wecanuseallJavalibrariesandframeworksIronPythonIronPythonisaPythonimplementationfortheMicrosoftdesignedCommonLanguageRuntime(CLR),popularlyknownasNETWithIronPython,youcanuseallCLRlibrariesandframeworksFeaturesofPythonAsmentionedearlier,PythonisascriptinglanguagethatincludesavastlibraryofaddonmodulesItsupportsintegrationofprebuiltcomponentsforcreatingcomplexapplicationsPythonhasfullaccesstooperatingsystem(OS)servicesFollowingareafewofitsfeatures:PythoniseasytolearnProgrammersfamiliarwithtraditionallanguageswillfindallthefamiliarconstructs,suchasloops,conditionalstatements,arrays,andsoonIthaseasiertoreadsyntaxItavoidstheuseofpunctuationcharacterslike{}$andItuseswhitespacetoindentlinesfordefiningblocksinsteadofusing

职业精品

现金采购管理制度.doc

材料采购及出入库管理制度.doc

日常采购管理流程.doc

采购管理.ppt

用户评论

0/200
    暂无评论
上传我的资料

精彩专题

相关资料换一换

资料评价:

/ 423
所需积分:0 立即下载

意见
反馈

返回
顶部