pycharm快速开始(英文版)

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

1QuickStartGuide.ExploringtheIDEWelcometoPyCharm!ThisshortguideaimstohelpyougetagriponthePyCharmIDE.Beforeyoustart…MakesurethatatleastonePythoninterpreter,versionfrom2.4to3.4isproperlyinstalledonyourcomputer.MindthatPyCharmisavailableintwoeditions:CommunityandProfessional.ThedifferencebetweentheeditionsisexploredinEditionComparisonMatrix.Notethatthedownloadpagecontainsinstallationinstructionsforthevariousplatforms;theseinstructionsmayvaryforthedifferentoperatingsystems.InitialsetupIfthisistheveryfirsttimeyoulaunchyourPyCharm,itwillaskyouseveralimportantquestions:First,whetheryoualreadyhavesettingyouwanttopreserve(forexample,fromapreviousversion)YourlicenseinformationAnd,finally,whichkeymapandthemeyouwanttouse:NotethatPyCharmhasseveralpre-definedkeymaps:forthosewholikeEclipseorVisualStudio,fortheEmacsfans,GNOME,KDEandmore.ExplorethelistofavailablekeymapsintheKeymappageofSettings/Preferencesdialog.2ForthededicatedVimusers,PyCharmsuggestsIdeaVimpluginthathelpscodinginPyCharmasifintheVimeditor.ForthosewhocannotlivewithoutrealEmacs,PyCharmprovidesthepossibilitytouseitasanexternaleditor.Iflateryoudecidethatyourinitialchoicewaswrong,youcanalwayschangeyoursettings.TolearnmoreaboutconfiguringtheIDEthemeandkeymap,refertoourdocumentationandtutorials:Seealso:GettingstartedwithPyCharmConfiguringkeyboardschemesSettingdefaultsfromtheWelcomescreenAgain,ifthisisyourveryfirststart(orifyouhavenoopenproject),you'llseetheWelcomescreen.IfyouclickthelinkConfigure,you'llseethepageoftheWelcomescreenthatsuggestsyoutoconfigureyourenvironment,plugins,importandexportsettings.YouhavetoclickConfigureoncemore-andseetheSettings/Preferencesdialog.Ifyoulookatthisdialog,you?llnoticetheheaderDefaultProject:3Whatdoesitmean?Thesesettingswillbeusedeverytimeyoucreateanewproject.Forexample,youwantallyounewlycreatedprojectstousethesameinterpreter-OK,youcandefinesuchaninterpreterintheTemplateProjectSettings.4TheIDEsettingscharacterizeyourworkingenvironment(keymaps,colorschemesetc.)Forexample,youwantyoureditortoalwaysshowlinenumbers.IntheSettings/Preferencesdialog,gototheIDEsettings,expandthenodeEditor,andintheAppearancepage,selectthecheckboxShowlinenumbers:Next,supposeyouwanttousesomeparticularcolorschemefortheeditor,andyouarenothappywiththecolorssuggestedbydefault.OK,selectthebasescheme,createitscopy,andthenchangecolors(theschemessuggestedbydefaultarenoteditable).Itisalsopossibletosetyourpreferredfontsizefortheeditor-thisisdoneintheFontspageoftheColorsandFontssettings.Again,youhavetocreateacopyoftheschemefirst,ifyouhaven'tdoneitalready,andthenspecifythedesiredfontsizefortheeditor.Thisfontsizewillapplytothecurrenteditortabs,andallthenewlyopenededitors.However,itdoesnotaffectthefontsizeoftheIDEcomponents.NotethatyoucanalwaysseetheresultsofyourexperimentsinthePreviewpane:5Thewholeprocedureisdescribedstep-by-stepinthetutorialWhatmyPyCharmlookslike.Whenaprojectisalreadycreated,youcanchangeitssettingsatanymoment.Configuringsettingsforthecurrentprojectwillbediscussedalittlebitlater,inthesectionCustomizeeverythingforyourproject!.Finally,youcanshoworhideactuallyalltheUIelements:toolbarbuttons,mainmenu,maintoolbar(menuView);PyCharmalsoenablesyoutochooseviewingmode.Refertothedocumentationfordetails:Seealso:PyCharmtoolwindowsPresentationandFullScreenviewingmodesProjectEverythingyoudoinPyCharm,isdonewithinthecontextofaproject.WhatismostinterestingaboutPyCharmprojectmanagement,isthepossibilitytoopenmultipleprojectsinoneframe.Whenyoucreateanewproject(File→NewProject),oropenanexistingone(File→Open),PyCharmsuggestsyoutochoosewhichwayyouwanttheprojecttobeopened:inanewwindow,inthesamewindowafterclosingthepreviouslyopenedproject,oraddedtothepreviouslyopenedproject.Youcanhaveasmanyprojectsopenedinonewindowasrequired.Sodoing,thefirstprojectisconsideredtheprimaryproject.Allthesymbolsoftheaddedprojectsarevisiblefromtheprimaryproject.Asanexercise,createanewemptyproject,whereyoucandevelopsomepurePythoncode.ThiscaseisdiscussedindetailinthetutorialGettingstartedwithPyCharm—inparticular,thesectionCreatingasimpleproject.Typesofprojects6Bytheway,PyCharmsuggestscreatingprojectsofthevarioustypes:Django,Flask,Pyramid,web2py,etc.Youcanexploretheavailabletypesyourself,whencreatinganewproject-justselectthenewprojecttypefromthedrop-downlist:Asyousee,PyCharmsupportsallthemajorPython-basedframeworks.Foreachofthesupportedprojecttypes,PyCharmcreatesthecorrespondingfileanddirectorystructure,andallthenecessaryartifacts.Refertotheproductdocumentation:DjangoFlaskPyramidGoogleAppEngineWeb2PyStarterOK,yourprojectisready.Beforeyoustartworkingwithit,justpressShifttwice.You'llseeapop-upwindowthatallowsfindinganythingandjumpingeverywhere:7Asyousee,thiswayonecansearchamongtheactions,settings,files,IDEcomponents,andmore.Notethatitisjustoneofthenumerousnavigationfeatures.We'llreturntothePyCharm'ssearchandnavigationfacilitiesalittlebitlater.Customizeeverythingforyourproject!Lookatthemaintoolbar—thereistheSettingsbutton.ClickingthisbuttonopenstheSettings/Preferencesdialogbox,whereyoucanchangeyou

1 / 24
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功