关闭

关闭

封号提示

内容

首页 复件 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 下载304 收藏0 阅读量754 暂无简介 简介 举报

简介:本文档为《复件 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

类似资料

编辑推荐

(俄)雅科夫列夫 一杯苦酒.pdf

注册质量工程师手册(第二版).pdf

《心理学》(Psychology)(戴维·迈尔斯)第7版.pdf

白寿彝全集.pdf

汽车基础知识大全[1].doc

职业精品

精彩专题

结婚彩礼真有那么重要吗?

原创于西周而后沿袭至今的彩礼,虽然被一部分家长奉为圭臬,但越来越多的年轻人对结婚必须要彩礼不以为然。彩礼引发的社会矛盾越来越受到关注,结婚是自己的事,如人饮水冷暖自知,至于要不要彩礼或者要多少彩礼,因人而异,因财力而已,不可一概而论。

用户评论

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

精选资料

热门资料排行换一换

  • 读者2009.pdf

  • 康熙蒙化府志(一).pdf

  • 高级财务会计理论与实务.pdf

  • Oxford 3000.doc

  • 金水婶.pdf

  • 黄山攻略.pdf

  • 诱惑的艺术.docx

  • 黄元吉道门语要.doc

  • 唐诗三百首新注 金性尧(上海古籍…

  • 资料评价:

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

    意见
    反馈

    返回
    顶部