Python编辑器,在Help菜单里找到了“IDLEHelp”(如图1所示),是Python的IDLE和Shell中的菜单说明
图1IDLEHelp
一、文件(File)菜单
主要是在Python里编程过程中对于文件的新建、打开、保存等操作。
Filemenu(ShellandEditor)文件菜单(Shell和编辑器)
NewFile新建文件
Createanewfileeditingwindow创建一个新的文件编辑窗口。
Open..打开…
OpenanexistingfilewithanOpendialog使用“打开"对话框打开现有文件。
RecentFiles最近的文件
Openalistofrecentfiles.Clickonetoopenit打开最近使用的文件列表。单击一个打开它。
OpenModule打开模块.
Openanexistingmodule(searchessyspath)打开现有模块(搜索sys.path)。
ClassBrowser类浏览器
Showfunctions,classes,andmethodsinthecurrentEditorfileinatreestructure.Intheshell,openamodulefirst
以树状结构显示当前编辑器文件中的函数、类和方法。在shel中,首先打开一个模块。
PathBrowser路径浏览器
Showsys.pathdirectories,modules,functions,classesandmethodsinatreestructure在树结构中显示sys.path目录、模块、函数、类和方法。
Save保存
Savethecurrentwindowtotheassociatedfile,ifthereisone.Windowsthathave
beenchangedsincebeingopenedorlastsavedhavea*beforeandafterthewindowtitleIfthereisnoassociatedfile,doSaveAsinstead
将当前窗口保存到关联的文件(如果有)。自打开或上次保存后已更改的窗口在窗口标题前后都有一个*号。如果没有关联的文件,请改为另存为。
SaveAs另存为
SavethecurrentwindowwithaSaveAsdialogThefilesavedbecomesthenewassociatedfileforthewindow.
用另存为对话框保存当前窗口。保存的文件将成为窗口的新关联文件。
SaveCopyAs..将副本另存为…
Savethecurrentwindowtodifferentfilewithoutchangingtheassociatedfile将当前窗口保存到其他文件,而不更改关联的文件。
PrintWindow打印窗口
Printthecurrentwindowtothedefaultprinter将当前窗口打印到默认打印机。
Close关闭
Closethecurrentwindow(asktosaveifunsaved)关闭当前窗口(如果未保存则要求保存)。
Exit退出
CloseallwindowsandquitlDLE(asktosaveunsavedwindows)关闭所有窗口并退出空闲状态(要求保存未保存的窗口)。
图2File菜单
二、编辑(Edit)菜单
主要是编程过程中对代码的编辑操作,包括:撤消、重做、剪切、粘贴、复制、查找、替换等功能。
Editmenu(ShellandEditor)编辑菜单(She和编辑器)
Undo撤消
UndothelastchangetothecurrentwindowAmaxlmumof1000changesmaybeundone
撤消对当前窗口的最后更改。最多可以撤消1000个更改。
Redo重做
Redothelastundonechangetothecurrentwindow重做对当前窗口的上次撤消更改。
Cut切割
Copyselectionintothesystem-wideclipboard,thendeletetheselection将所选内容复制到系统范围的剪贴板中;然后删除所选内容。
Copy复制
Copyselectionintothesystem-wideclipboard将所选内容复制到系统范围的剪贴板中。
Paste粘贴
Insertcontentsofthesystem-wideclipboardintothecurrentwindow将系统范围剪贴板的内容插入当前窗口。
Theclipboardfunctionsarealsoavailableincontextmenus剪贴板功能也可以在上下文菜单中使用。
SelectAl全选
Selecttheentirecontentsofthecurrentwindow选择当前窗口的全部内容。
Find...查找…
Openasearchdialogwithmanyoptions打开包含许多选项的搜索对话框
FindAgain再找一次
Repeatthelastsearch,ifthereisone如果有,重复上一次搜索。
FindSelection查找选定内容
Searchforthecurrentlyselectedstring,ifthereisone搜索当前选定的字符串(如果有)。
FindinFiles在文件中查找…
Openafilesearchdialog.Putresultsinanewoutputwindow打开文件搜索对话框。将结果放入新的输出窗口。
Replace替换…
Openasearch-and-replacedialog打开“搜索和替换"对话框。
GotoLine转到行
Movecursortothelinenumberrequestedandmakethatlinevisible将光标移到请求的行号并使该行可见,
ShowCompletions显示完成
Openascrollablelistallowingselectionofkeywordsandattributes.SeeCompletionsintheEditingandnavigationsectionbelow,
打开一个可滚动列表,允许选择关键字和属性。请参阅下面编辑和导航部分中的完成部分。
ExpandWord展开字
Expandaprefixyouhavetypedtomatchafullwordinthesamewindow,repeattogetadillerentexpansion
展开已键入的前缀以匹配同一窗口中的完整单词;重复可获得不同的展开方式。
Showcalltip显示呼叫提示
Afteranunclosedparenthesisforafunction,openasmallwindowwithfunction.parameterhints.SeeCaliltipsintheEditingandnavigationsectionbelow
在函数的未闭合圆括号之后,打开一个带有函数参数提示的小窗口。请参见下面编辑和导航部分中的调用提示。
Showsurroundingparens显示周围的parens
Highlightthesurroundingparenthesis突出显示周围的括号。
图3Edit菜单
三、格式(Format)菜单
主要是对代码进行格式化操作,包括:缩进、注释、段落格式等功能。
Formatmenu(Editorwindowonly)格式菜单(仅限编辑器窗口)
lndentRegion缩进区域
Shiftselectedlinesrightbytheindentwidth(default4spaces)按缩进宽度右移选定行(默认为4个空格)。
DedentRegionDedent地区
Shiftselectedlinesleftbytheindentwidth(defauft4spaces)按缩进宽度向左移动选定行(默认为4个空格))。
CommentOutRegion注释区域
lnsert#infrontofselectedlines在选定行前面插入。
UncommentRegion非注释区域
Removeleading#or#llfromselectedlines从选定行中删除前导或。
TabifyRegion禁忌区
Turnleadingstretchesofspacesintotabs.(Note:Werecommendusing4spaceblockstoindentPythoncode.)
将空格的前导部分变成制表符。(注意:我们建议使用4个空格块来缩进Python代码。)
UntabifyRegion未分裂地区
Tunalltabsintothecorrectnumberofspaces将所有制表符转换为正确的空格数。
ToggleTabs切换选项卡
Openadialogtoswitchbetweenindentingwithspacesandtabs打开一个对话框,在缩进空格和制表符之间切换。
NewindentWidth新缩进宽度
Openadialogtochangeindentwidth.TheaccepteddefaultbythePythoncommunityis4spaces
打开对话框以更改缩进宽度。Python社区接受的默认值是4个空格。
FormatParagraph设置段落格式
Reformatthecurrentblank-line-delimitedparagraphincommentblockormultilinestringorselectedlineinastring.AlllinesintheparagraphwillbeformattedtolessthanNcolumns,whereNdefaultsto72.
重新格式化注释块或多行字符串或字符串中选定行中当前以空行分隔的段落。段落中的所有行的格式都将小于N列,其中N默认为72列。
Striptrailingwhitespace册除尾随空白
Removetrailingspaceandotherwhitespacecharactersafterthelastnon-whitespace(characterofalinebyapplyingstr.rstriptoeachline,includinglineswithinmultilinestrings.ExceptforShellwindows,removeextranewlinesattheendofthefile.
通过对每一行(包括多行字符串中的行)应用str.rstrip,删除行的最后一个非空白字符之后的尾随空格和其他空白字符。除了Shell窗口之外,请删除文件末尾的额外换行符。
图4Format菜单
四、运行(Run)菜单
主要是代码编写好之后,调试、运行操作。
Runmenu(Editorwindowonly)运行菜单(仅限编辑器窗口)
RunModule运行模块
DoCheckModule.Ifnoerror,restarttheshelltocleantheenvironment,thenexecutethemodule:OutputisdisplayedintheShellwindow.NotethatoutputrequiresuseofprintorwriteWhenexecutioniscomplete,theShellretainsfocusanddisplaysaprompt.AtthispointonemayinteractivelyexploretheresulttofexecutionThisissimilartoexecutingafilewithpython-ifileatacommandline.
检查模块。如果没有错误,请重新启动shell以清理环境,然后执行模块。输出将显示在Shell窗口中。请注意,输出需要使用打印或写入。执行完成后,Shell将保留焦点并显示提示。此时,可以交互地探索执行的结果。这类似于在命令行使用python-i文件执行文件。
Run...Customized运行自定义
SameasRunModule,butrunthemodulewithcustomizedsettings.CommandLineArgumentsextendsys.argvasifpassedonacommandline.ThemodulecanberunintheShellwithoutrestarting
与运行模块相同,但使用自定义设置运行模块。命令行参数扩展sys.argv,就像在命令行上传递一样。模块可以在Shell中运行,而无需重新启动。
CheckModule检查模块
CheckthesyntaxofthemodulecurrentlyopenintheEditorwindow.IfthemodulehasnotbeensavedIDLEwilleitherprompttheusertosaveorautosave,asselectedintheGeneraltaboftheldleSettingsdialog,Ifthereisasyntaxerror,theapproximatelocationisindicatedintheEditorwindow
检查编辑器窗口中当前打开的模块的语法。如果模块尚未保存,则将提示用户保存或自动保存,如在“空闲设置"对话框的“常规"选项卡中所选。如果存在语法错误,则在编辑器窗口中指示近似位置。
PythonShell蟒蛇壳
OpenorwakeupthePythonShellwindow打开或唤醒PythonShell窗口。
图5Run菜单
五、Shell菜单
注意这个菜单只有在Shell当中有,IDLE中是没有的。
Shellmenu(Shellwindowonly)Shell菜单(仅限Shell窗口)
ViewLastRestart查看上次重新启动
ScrolltheshellwindowtothelastShellrestart.将shell窗口滚动到最后一次shell重新启动。
RestartShell重新启动Shell
Restarttheshelltocleantheenvironment重新启动shell以清理环境。
PreviousHistory以前的历史
Cyclethroughearliercommandsinhistorywhichmatchthecurrententry循环浏览历史记录中与当前条目匹配的早期命令。
NextHistory下一个历史
Cyclethroughlatercommandsinhistorywhichmatchthecurrententry循环查看历史记录中与当前条目匹配的后续命令。
lnterruptExecution中断执行
Stoparunningprogram停止正在运行的程序。
图6Shell菜单
六、调试(Debug)菜单
这个菜单也只存在于Shell当中,IDLE中是没有的。
Debugmenu(Shellwindowonly)调试菜单(仅限Shell窗口)
GotoFile/Line转到文件/行
Lookonthecurrentline:withthecursor,andthelineaboveforafilenameandlinenumber.Iffound,openthefileifnotalreadyopen,andshowtheline.UsethistoviewsourcelinesreferencedinanexceptiontracebackandlinesfoundbyFindinFiles.AlsoavailableinthecontextmenuoftheShellwindowandOutputwindows.
看看当前行。使用光标,并在上面的行中输入文件名和行号。如果找到,打开文件(如果尚未打开),并显示行。使用此选项可以查看异常回溯中引用的源行和文件中查找找到的行。也可以在Shell窗口和输出窗口的上下文菜单中使用。
Debugger(toggle)调试器(切换)
Whenactivated,codeenteredintheShellorrunfromanEditorwillrununderthedebugger.IntheEditor,breakpointscanbesetwiththecontextmenu.Thisfeatureisstillincompleteandsomewhatexperimental.
激活后,在Shell中输入或从编辑器运行的代码将在调试器下运行。在编辑器中,可以使用上下文菜单设置断点。这个功能仍然不完整,有些实验性。
StackViewer堆栈查看器
Showthestacktracebackofthelastexceptioninatreewidget,withaccesstolocalsandglobals.
显示树小部件中最后一个异常的堆栈回溯,可以访问局部变量和全局变量。
Auto-openStackViewer自动打开堆栈查看器
Toggleautomaticallyopeningthestackvieweronanunhandledexception切换在未处理的异常上自动打开堆栈查看器。
图7Debug菜单
七、选项(Option)菜单
这个在IDLE和Shell当中都有,主要是配置两个窗口的字体、显示、行号等功能,特别是行号,这个在其他代码编辑器是常见的,Python默认是没有显示行号的,如果要显示必须在“ShowLineNumbers”打开,注意这个功能只存在于IDLE中。
Optionsmenu(ShellandEditor)选项菜单(Shell和编辑器)
ConfigureIDLE配置空闲
Openaconfigurationdialogandchangepreferencesforthefollowing:fonts,indentation,keybindings,textcolorthemes,startupwindowsandsize,additionalhelpsources,andextensions.OnmacoS,opentheconfigurationdialogbyselectingPreferencesintheapplicationmenuFormoredetails,seeSettingpreferencesunderHelpandpreferences
打开配置对话框并更改下列项的首选项:字体、缩进、键绑定、文本颜色主题、启动窗口和大小、其他帮助源和扩展名。在macOS上,通过选择应用程序菜单中的首选项打开配置对话框。有关详细信息,请参见“帮助和首选项"下的“设置首选项”。
Mostconfigurationoptionsapplytoallwindowsorallfuturewindows.Theoptionitemsbelowonlyapplytotheactivewindow
大多数配置选项适用于所有窗口或所有未来窗口。下面的选项仅适用于活动窗口。
Show/HideCodeContext(EditorWindowonly)显示/隐藏代码上下文(仅限编辑器窗口)
Openapaneatthetopoftheeditwindowwhichshowstheblockcontextofthecodewhichhasscrolledabovethetopofthewindow.SeeCodeContextintheEditingandNavigationsectionbelow
打开编辑窗口顶部的一个窗格,该窗格显示在窗口顶部滚动的代码块上下文。请参见下面编辑和导航部分中的代码上下文。
ShowHideLineNumbers(EditorWindowonly)显示/隐藏行号(仅限编辑器窗口)
OpenacolumntotheleftoftheeditwindowwhichshowsthenumberofeachlineoftextThedefaultisoff,whichmaybechangedinthepreferences(seeSettingpreferences)
打开编辑窗口左侧的列,其中显示每行文本的编号。默认值为“关”,可在首选项中更改(请参见设置首选项)。
Zoom/RestoreHeight缩放/还原高度
TogglesthewindowbetweennormalsizeandmaximumheightTheinitialsizedefaultsto40linesby80charsunlesschangedontheGeneraltaboftheConfigureIDLEdialog.ThemaximumheightforascreenisdeterminedbymomentarilymaximizingawindowthefirsttimeoneiszoomedonthescreenChangingscreensettingsmayinvalidatethesavedheightThistogglehasnoeffectwhenawindowismaximized
在正常大小和最大高度之间切换窗口。除非在“"配置空闲"对话框的“常规"选项卡上更改,否则初始大小默认为40行80个字符。屏幕的最大高度由第一次在屏幕上缩放时瞬间最大化窗口来确定。更改屏幕设置可能会使保存的高度无效。当窗口最大化时,此切换无效。
图8Option菜单
八、窗口(Window)菜单
这里显示的是你打开的所有程序,可以在不同程序之间进行切换。
Windowmenu(ShellandEditor)窗口菜单(Shell和编辑器)
Liststhenamesofallopenwindows;selectonetobringittotheforeground(deiconifyingitifnecessary)
列出所有打开窗口的名称;选择一个窗口将其置于前台(必要时将其取消圆锥化)
图9Window菜单
九、帮助(Help)菜单
Helpmenu(ShellandEditor)帮助菜单(Shell和编辑器)
AboutIDLE关于空闲
IDLEHelp空闲帮助
DisplaythisIDLEdocument,detailingthemenuoptions,basiceditingandnavigation,andothertips
显示此空闲文档,详细说明菜单选项、基本编辑和导航以及其他提示。
PythonDocsPython文档
TurtleDemo海龟演示
RuntheturtledemomodulewithexamplePythoncodeandturtledrawings使用示例Python代码和turtle图形运行turtledemo模块。
AdditionalhelpsourcesmaybeaddedherewiththeConfigureIDLEdialogundertheGeneraltab.SeetheHelpsourcessubsectionbelowformoreonHelpmenuchoices
其他帮助源可以通过“常规"选项卡下的“配置空闲“对话框添加到此处。有关“帮助"菜单选项的详细信息,请参见下面的“帮助源”小节。
图10Help菜单
十、右键(Context)菜单
在编辑器中按右键看到的功能菜单,除了常见的复制、剪切、粘贴,还有其他调试的功能,请你慢慢去摸索吧。
ContextMenus上下文菜单
Openacontextmenubyright-clickinginawindow(Control-clickonmacoS)ContextmenushavethestandardclipboardfunctionsalsoontheEditmenu
通过在窗口中单击鼠标右键(在macOS上单击控件)打开上下文菜单。上下文菜单在“编辑”菜单上也具有标准剪贴板功能。
Editorwindowsalsohavebreakpointfunctions.Lineswithabreakpointsetarespeciallymarked.Breakpointsonlyhaveaneffectwhenrunningunderthedebugger.Breakpointsforafilearesavedintheuser’sidlercdirectory
编辑器窗口也有断点函数。具有断点集的行被特别标记。只有在调试器下运行时,断点才起作用。文件的断点保存在用户的.idlerc目录中。
SetBreakpoint设置断点
Setabreakpointonthecurrentline在当前行上设置断点。
ClearBreakpoint清除断点
Clearthebreakpointonthatline清除该行上的断点。
ShellandOutputwindowsalsohavethefollowingShell和输出窗口也有以下内容。
Gotofile/line转到文件/行
SameasinDebugmenu与“调试”菜单中的相同。
TheShellwindowalsohasanoutputsqueezingfacilityexplainedinthePythonShellwindowsubsectionbelow
Shell窗口还有一个输出压缩工具,下面的pythonshell窗口小节将对此进行说明。
Squeeze挤压
lfthecursorisoveranoutputline,squeezealltheoutputbetweenthecodeaboveandthepromptbelowdowntoa'Squeezedtextlabel
如果光标位于输出行上,请将上面的代码和下面的提示之间的所有输出压缩为“压缩文本"标签。
图11Context菜单
十一、设置首选项(Settingpreferences)
点击“Option”,点击“ConfigureIDLE”可以进入首选项设置,包括字体、文字大小等编辑器界面设置,还包括一些常规设置,例如打开IDLE默认是进Shell还是编辑器呢?还有扩展功能的使用等,都在这里面了。
Settingpreferences设置首选项
Thefontpreferences,highlighting,keys,andgeneralpreferencescanbechangedviaConfigureIDLEontheOptionmenuNon-defaulusersettingsaresavedina.idlercdirectoryintheuser'shomedirectory.Problemscausedbybaduserconfigurationfilesaresolvedbyeditingordeletingoneormoreofthefilesinidlerc
字体首选项、突出显示、键和常规首选项可以通过“选项"菜单上的“配置空闲"进行更改。非默认用户设置保存在用户主目录中的.idlerc目录中。通过编辑或删除.idlerc中的一个或多个文件,可以解决由错误的用户配置文件引起的问题。
OntheFonttab,seethetextsamplefortheeffectoffontfaceandsizeonmultiplecharactersinmultiplelanguages.Editthesampletoaddothercharactersofpersonalinterest.Usethesampletoselectmonospacedfonts.lfparticularcharactershaveproblemsinShelloraneditor,addthemtothetopofthesampleandtrychangingfirstsizeandthenfont
在“字体"选项卡上,请参阅文本示例以了解多语言中字体的字体和大小对多个字符的影响。编辑示例以添加其他个人感兴趣的字符。使用示例选择等距字体。如果特定字符在Shell或编辑器中有问题,请将其添加到示例顶部,然后尝试更改第一个大小,然后更改字体。
OntheHighlightsandKeystab,selectabuilt-inorcustomcolorthemeandkeysetTouseanewerbuilt-incolorthemeorkeysetwitholderIDLEs,saveitasanewcustomthemeorkeysetanditwellbeaccessibletoolderIDLES
在“高光和关键点"选项卡上,选择内置或自定义颜色主题和关键点集。若要将较新的内置颜色主题或密钥集与较旧的idle一起使用,请将其另存为新的自定义主题或密钥集,并且较I日的idle可以访问该主题或密钥集。
图12Settingpreferences
十二、文本颜色(Textcolors)
在编辑器当中,用不同的颜色表示关键字、变量、类、字符串、注释等等,这个请大家平常多留心,可以让你很快发现错误,是一个很好的功能。通过点击“Option”,点击“ConfigureIDLE”,在打开窗口中找到“CustomHighlighting”可以进行自定义。
Textcolors文本颜色
ldledefaultstoblackonwhitetext,butcolorstextwithspecialmeanings.Fortheshell,theseareshelloutput,shellerror,useroutput,andusererror.ForPythoncode,attheshellpromptorinaneditor,thesearekeywords,builtinclassandfunctionnames,namesfollowingclassanddef,strings,andcomments.Foranytextwindow,thesearethecursor(whenpresent),foundtext(whenpossible),andselectedtext.
ldle默认为黑白文本,但会给文本添加特殊含义的颜色。对于shell,这些是shell输出、shell错误、用户输出和用户错误。对于Python代码,在shell提示下或在编辑器中,这些是关键字、内置类和函数名、类和def之后的名称、字符串和注释。对于任何文本窗口,它们是光标(如果存在)、找到的文本(如果可能)和选定的文本。
Textcoloringisdoneinthebackground,souncolorizedtextisoccasionallyvisible.Tochangethecolorscheme,usetheConfigureIDLEdialogHighlightingtab.The
markingofdebuggerbreakpointlinesintheeditorandtextinpopupsanddialogsisnotuser-configurable.
文本着色是在背景中完成的,因此未着色的文本偶尔可见。要更改颜色方案,请使用“配置空闲"对话框的“亮显"选项卡。在编辑器中标记调试器断点行,在弹出窗口和对话框中标记文本是用户不可配置的。
图13Textcolors
图14CustomHighlighting
十三、自动缩进(Automaticindentation)
在使用if等语句时,会在下一行自动缩进4个空格。
Automaticindentation自动缩进
Afterablock-openingstatement,thenextlineisindentedby4spaces(inthePythonShellwindowbyonetab).Aftercertainkeywords(break,returnetc.)thenextlineisdedented.Inleadingindentation,Backspacedeletesupto4spacesiftheyarethere.Tabinsertsspaces(inthePythonShellwindowonetab),numberdependsonIndentwidth.Currently,tabsarerestrictedtofourspacesduetoTclTklimitations
在blockopening语句之后,下一行将缩进4个空格(在PythonShel窗口中缩进一个选项卡)。在某些关键字(break、return等)之后,下一行是dedented。在前导缩进中,退格删除最多4个空格(如果有)。Tab插入空格(在PythonShell窗口的一个Tab中),数字取决于缩进宽度。目前,由于TcI/Tk的限制,标签被限制为四个空格。
Seealsotheindent/dedentregioncommandsontheFormatmenu另请参见"格式"菜单上的“缩进/删除区域"命令。
图15Automaticindentation
十四、PythonShell窗口
PythonShellwindowPythonShell窗口
withIDLE'SShell,oneenters,edits,andrecallscompletestatements.Mostconsolesandterminalsonlyworkwithasinglephysicallineatatime.
使用IDLE的Shell,可以输入、编辑和调用完整的语句。大多数控制台和终端一次只能使用一条物理线路。
WhenonepastescodeintoShell,itisnotcompiledandpossiblyexecuteduntilonehitsRetum.OnemayeditpastedcodefirstlfonepastesmorethatonestatementintoShell,theresultwillbeaSyntaxErrorwhenmultiplestatementsarecompiledasiftheywereone
当一个人将代码粘贴到Shell中时,它不会被编译,可能会被执行,直到点击返回。可以先编辑粘贴的代码。如果一个将多个语句粘贴到Shell中,当多个语句被编译为一个语句时,结果将是一个SyntaxError。
TheeditingfeaturesdescribedinprevioussubsectionsworkwhenenteringcodeinteractivelyIDLE'sShellwindowalsorespondstothefollowingkeys
当以交互方式输入代码时,前面小节中描述的编辑功能可以工作。IDLE的Shell窗口还响应以下键。
*C-cinterruptsexecutingcommand*C-C中断执行命令
*C-dsendsend-of-file;closeswindowiftypedata>>prompt*C-d发送文件结尾;如果在>>提示下键入,则关闭窗口
*Alt-/(Expandword)isalsousefultoreducetyping*Alt-/(展开word)也有助于减少键入
Commandhistory命令历史记录
*Alt-pretrievespreviouscommandmatchingwhatyouhavetypedOnmacOSuseC-p
*Alt-p检索与您键入的内容匹配的上一个命令。在macOS上使用C-p。
*Alt-nretrievesnextOnmacOSuseC-n*Alt-n检索下一个。在macoS上使用C-n。
*Returnwhileonanypreviouscommandretrievesthatcommand*在任何前一个命令上返回时检索该命令
图16PythonShell
十五、编辑器(Editor)窗口
Editorwindows编辑器窗口
IDLEmayopeneditorwindowswhenitstarts,dependingonsettingsandhowyoustartIDLE.Thereafter,usetheFilemenu.Therecanbeonlyoneopeneditorwindowforagivenfile
IDLE在启动时可能会打开编辑器窗口,具体取决于设置和启动IDLE的方式。此后,使用“文件“菜单。对于给定的文件,只能有一个打开的编辑器窗口。
Thetitlebarcontainsthenameofthefile,thefullpath,andtheversionofPythonandIDLErunningthewindowThestatusbarcontainsthelinenumber(Ln)andcolumnnumber(Col').Linenumbersstartwith1,columnnumberswith0
标题栏包含文件名、完整路径以及运行窗口的Python和IDLE版本。状态栏包含行号('Ln')和列号('Col)。行号以1开头;列号以0开头。
IDLEassumesthatfileswithaknown.py*extensioncontainPythoncodeandthatotherfilesdonotRunPythoncodewiththeRunmenu.
IDLE假设扩展名为.py*的文件包含Python代码,而其他文件则不包含。使用Run菜单运行Python代码。
图17Editorwindows
以上15个Python菜单的名称及功能翻译可能不是很专业,但仔细体会下来也差不多,希望你多去使用,也不一定要使用中文版,用多了自然就明白是什么作用了。