如何编写一个简单的程序这里为大家介绍一下如何开始编写一个真正的但是简单程序。程序的概念:下面一段,关于程序的概念,内容来自维基百科:先阅读一段英文的:computerprogramandsourcecode,看不懂不要紧,可以跳过去,直接看下一条。Acomputerprogram,orjustaprogram,isasequenceofinstructions,writtentoperformaspecifiedtaskwithacomputer.[1]Acomputerrequiresprogramstofunction,typicallyexecutingtheprogram'sinstructionsinacentralprocessor.[2]Theprogramhasanexecutableformthatthecomputercanusedirectlytoexecutetheinstructions.Thesameprograminitshuman-readablesourcecodeform,fromwhichexecutableprogramsarederived(e.g.,compiled),enablesaprogrammertostudyanddevelopitsalgorithms.Acollectionofcomputerprogramsandrelateddataisreferredtoasthesoftware.Computersourcecodeistypicallywrittenbycomputerprogrammers.[3]Sourcecodeiswritteninaprogramminglanguagethatusuallyfollowsoneoftwomainparadigms:imperativeordeclarativeprogramming.Sourcecodemaybeconvertedintoanexecutablefile(sometimescalledanexecutableprogramorabinary)byacompilerandlaterexecutedbyacentralprocessingunit.Alternatively,computerprogramsmaybeexecutedwiththeaidofaninterpreter,ormaybeembeddeddirectlyintohardware.Computerprogramsmayberankedalongfunctionallines:systemsoftwareandapplicationsoftware.Twoormorecomputerprogramsmayrunsimultaneouslyononecomputerfromtheperspectiveoftheuser,thisprocessbeingknownasmultitasking.计算机程序计算机程序(ComputerProgram)是指一组指示计算机或其他具有信息处理能力装置每一步动作的指令,通常用某种程序设计语言编写,运行于某种目标体系结构上。打个比方,一个程序就像一个用汉语(程序设计语言)写下的红烧肉菜谱(程序),用于指导懂汉语和烹饪手法的人(体系结构)来做这个菜。通常,计算机程序要经过编译和链接而成为一种人们不易看清而计算机可解读的格式,然后运行。未经编译就可运行的程序,通常称之为脚本程序(script)。程序,简而言之,就是指令的集合。但是,有的程序需要编译,有的不需要。Python编写的程序就不需要,因此她也被称之为解释性语言,编程出来的层序被叫做脚本程序。在有的程序员头脑中,有一种认为“编译型语言比解释性语言高价”的认识。这是错误的。不要认为编译的就好,不编译的就不好;也不要认为编译的就“高端”,不编译的就属于“低端”。有一些做了很多年程序的程序员或者其它什么人,可能会有这样的想法,这是毫无根据的。不争论。用得妙就是好。用IDLE的编程环境能够写Python程序的工具很多,比如记事本就可以。当然,很多人总希望能用一个专门的编程工具,Python里面自带了一个,作为简单应用是足够了。另外,可以根据自己的喜好用其它的工具,比如我用的是vim,有不少人也用eclipse,还有notepad++,等等。软件领域为编程提供了丰富多彩的工具。以Python默认的IDE为例,如下所示:操作:File->Newwindow这样,就出现了一个新的操作界面,在这个界面里面,看不到用于输入指令的提示符:>>>,这个界面有点像记事本。说对了,本质上就是一个记事本,只能输入文本,不能直接在里面贴图片。写两个大字:Hello,WorldHello,World.是面向世界的标志,所以,写任何程序,第一句一定要写这个,因为程序员是面向世界的,绝对不畏缩在某个局域网内,所以,所以看官要会科学上网,才能真正与世界Hello。直接上代码,就这么一行即可。print"Hello,World"如下图的样式前面说过了,程序就是指令的集合,现在,这个程序里面,就一条指令。一条指令也可以成为集合。注意观察,菜单上有一个RUN,点击这个菜单,在下拉列表里面选择RunModule。会弹出对话框,要求把这个文件保存,这就比较简单了,保存到一个位置,看官一定要记住这个位置,并且取个文件名,文件名是以.py为扩展名的。都做好之后,点击确定按钮,就会发现在另外一个带有>>>的界面中,就自动出来了Hello,World...