python学习第五天

Python代码运行助手

Python代码运行助手可以让你在线输入Python代码,然后通过本机运行的一个Python脚本来执行代码。原理如下:

  • 在网页输入代码:

write-py-code

  • 点击Run按钮,代码被发送到本机正在运行的Python代码运行助手;

  • Python代码运行助手将代码保存为临时文件,然后调用Python解释器执行代码;

  • 网页显示代码执行结果:

py-code-result

下载

点击右键,目标另存为:learning.py

备用下载地址:learning.py

运行

在存放learning.py的目录下运行命令:

C:\Users\michael\Downloads> python learning.py

如果看到Ready for Python code on port 39093...表示运行成功,不要关闭命令行窗口,最小化放到后台运行即可:

┌────────────────────────────────────────────────────────┐
│Command Prompt                                    - □ x │
├────────────────────────────────────────────────────────┤
│Microsoft Windows [Version 10.0.0]                      │
│(c) 2015 Microsoft Corporation. All rights reserved.    │
│                                                        │
│C:\Users\michael\Downloads> python learning.py          │
│Ready for Python code on port 39093...                  │
│Press Ctrl + C to exit...                               │
│                                                        │
│                                                        │
│                                                        │
│                                                        │
│                                                        │
└────────────────────────────────────────────────────────┘

python的博客纯属复制过来,这代码运行助手的环节,我没调通,有朋友知道原因可以告诉我,原文链接:https://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000/001432523496782e0946b0f454549c0888d05959b99860f000

猜你喜欢

转载自blog.csdn.net/liuchangjie0112/article/details/81030945