怎么样进行Python程序的编写
<div style="color: black; text-align: left; margin-bottom: 10px;">
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/4cd6ad0cae0e49618f4a4ff6c252fcf1~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723893642&x-signature=2y7cX3UQEYuXa%2B6Sq%2FT4mFkQTBk%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">1、</span><span style="color: black;">运用</span>Python<span style="color: black;">自己</span><span style="color: black;">供给</span>的交互式解释器</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">在Linux、Windows、Mac OS的命令行窗口或Shell窗口,执行python命令,<span style="color: black;">起步</span>Python交互式解释器。交互式解释器会等待用户输入Python语句。输入Python语句并回车,解释器会执行语句并输出结果。交互式解释器是学习Python语言比较好的工具,优点是输入Python语句<span style="color: black;">能够</span>立即得到反馈。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Windows环境下:</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Windows<span style="color: black;">起步</span>Python交互式解释器有两种方式。<span style="color: black;">第1</span>种方式是进入Pyhton的安装目录,直接运行python.exe程序;第二种方式是进入Windows命令行窗口,在命令行窗口<span style="color: black;">起步</span>python.exe。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">在Windows命令行窗口<span style="color: black;">起步</span>Python交互式解释器,<span style="color: black;">首要</span><span style="color: black;">必须</span>将Python安装目录的路径,添加到Path系统环境变量。否则,只能进入Python安装目录<span style="color: black;">起步</span>交互式解释器。在安装Python3.7时,<span style="color: black;">倘若</span>勾选了【Add Python3.7 to PATH】选项,安装程序会自动把Python安装目录添加到Path系统环境变量。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">进入Windows命令行窗口,输入python命令<span style="color: black;">起步</span>交互式解释器,输入python语句并执行,如下图所示。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/16cd29c329554ac397a4d295115787fc~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723893642&x-signature=TmnreSCmy%2B4N4cEXrRMlzZXo16c%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">linux环境下:</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">用SSH客户端连接CentOS服务器,打开终端命令输入窗口,输入python命令,<span style="color: black;">起步</span>python交互式解释器,输入pyhton语句并执行。如下图所示。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/30f00297f54a4fefa390c1d641b2de79~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723893642&x-signature=iM%2F38KmFzD7xr92DNbn3A3olyhc%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">max os环境下:</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">在Max OS环境<span style="color: black;">起步</span>Python交互式解释器<span style="color: black;">亦</span>有两种方式。一种是进入python的安装目录,执行python.exec文件;第二种方式是直接在终端输入open /usr/bin/python命令,终端会弹出Python窗口。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/3ec863ee5f1344d8a6f5b95cefb97503~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723893642&x-signature=OTwfl6mnIqtt5oDt%2F0LZ%2BNotoTE%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">2、</span><span style="color: black;">运用</span>Python<span style="color: black;">自己</span><span style="color: black;">供给</span>的IDEL集成<span style="color: black;">研发</span>环境</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Pyhton<span style="color: black;">自己</span><span style="color: black;">供给</span>了一个简洁的集成<span style="color: black;">研发</span>环境,具备基本的IDE功能。利用IDLE<span style="color: black;">能够</span>较为方便地创建、运行、测试和调试Python程序。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">起步</span>IDEL:</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Winodws环境下<span style="color: black;">起步</span>IDLE有多种方式,<span style="color: black;">能够</span><span style="color: black;">经过</span>快捷菜单、桌面图标、进入Python安装目录直接运行IDLE等方式<span style="color: black;">起步</span>IDLE。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Mac OS<span style="color: black;">起步</span>IDLE的方式同<span style="color: black;">起步</span>交互解释器相同,<span style="color: black;">能够</span>在Python的安装目录直接<span style="color: black;">起步</span>,<span style="color: black;">亦</span><span style="color: black;">能够</span>在终端窗口输入open /usr/bin/idle命令<span style="color: black;">起步</span>。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">IDEL的简单<span style="color: black;">运用</span>:</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">IDLE<span style="color: black;">起步</span>后的界面如下图所示。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/530f7c02e6324a4eb027118f030b2569~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723893642&x-signature=Gr0ZfNyctka2gdtvC7uiL3NpHpo%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">IDLE本身<span style="color: black;">便是</span>一个Python shell,<span style="color: black;">能够</span>在IDLE窗口直接输入和执行Python语句,IDLE自动对输入的语句进行排版和关键词高亮<span style="color: black;">表示</span>。如下图所示。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/5a95f105087844618cd10fd444add601~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723893642&x-signature=zjQztkR2xfP%2Fte8djjYuF0Y6uJs%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">IDLE还<span style="color: black;">能够</span><span style="color: black;">保留</span>、打开并执行代码文件。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">(1)在IDLE窗口,<span style="color: black;">选取</span>【File】【New File】命令,在编辑窗口输入代码并<span style="color: black;">保留</span>。如下图所示。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/b3aa72fe12df4ef38866866c54f11b7a~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723893642&x-signature=zX%2FqtYRDi7CCjslAWwIg%2F2161wI%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">(2)<span style="color: black;">选取</span>【Run】【Run Module】命令,执行代码文件。执行后的输出结果如下图所示。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/bcbee99959a048aeac0d9fe419d28f04~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723893642&x-signature=IqEeldHIJ3FFUMHnjoev4vC%2Bejc%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">以上<span style="color: black;">便是</span><span style="color: black;">怎样</span>进行Python程序的编写的<span style="color: black;">仔细</span>内容,<span style="color: black;">更加多</span>请关注其它<span style="color: black;">关联</span><span style="color: black;">文案</span>!</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">更加多</span>技巧请《转发 + 关注》哦!</p>
</div>
谷歌网站排名优化 http://www.fok120.com/ 回顾历史,我们不难发现:无数先辈用鲜血和生命铺就了中华民族复兴的康庄大道。 楼主发的这篇帖子,我觉得非常有道理。
页:
[1]