如何下载,安装和使用Python空闲编辑器?

Python is a popular programming language used by a lot of people from different professions. Python is a scripting language supported by different platforms and operating systems like Windows, Linux, MacOS, BSD, etc. Developing and running python can be done in different ways but in a practical way, we generally need some editor. Python Idle is a simple editor that provides basic features of advanced Integrated Development Environments.

Python是一种流行的编程语言,许多不同专业的人都在使用它。 Python是受不同平台和操作系统(例如Windows,Linux,MacOS,BSD等)支持的脚本语言。开发和运行python的方法可以不同,但​​实际上,我们通常需要一些编辑器。 Python Idle是一个简单的编辑器,提供高级集成开发环境的基本功能。

对于Windows安装 (Install For Windows)

In Windows Idle is provided with the Python libraries and executable. In this tutorial, we will download Python 3.6 with Idle from the following link. We prefer 64 bit Python.

在Windows中,Idle随Python库和可执行文件一起提供。 在本教程中,我们将从下面的链接下载带空闲的Python 3.6。 我们更喜欢64位Python。

https://www.python.org/ftp/python/3.6.3/python-3.6.3-amd64.exe

https://www.python.org/ftp/python/3.6.3/python-3.6.3-amd64.exe

Install For Windows
Install For Windows
对于Windows安装

为Ubuntu,Debian,Mint,Kali安装(Install For Ubuntu, Debian, Mint, Kali)

We can install idle with different ways but the easiest and reliable way is using package manager named apt .

我们可以通过不同的方式安装idle ,但是最简单可靠的方法是使用名为apt软件包管理器。

$ sudo apt install idle
Install For Ubuntu, Debian, Mint, Kali
Install For Ubuntu, Debian, Mint, Kali
为Ubuntu,Debian,Mint,Kali安装

为Fedora,CentOS,RHEL安装(Install For Fedora, CentOS, RHEL)

We can install Python Idle in the Fedora, CentOS and RHEL distributions like below.

我们可以在下面的Fedora,CentOS和RHEL发行版中安装Python Idle。

$ sudo yum install idle

交互式Python Shell (Interactive Python Shell)

The idle main window is an interactive Python shell. We can use this shell for simple and fast scripting. This console provides the following features.

空闲的主窗口是一个交互式Python shell。 我们可以使用此shell进行简单快速的脚本编写。 此控制台提供以下功能。

  • Creating and saving script files

    创建和保存脚本文件
  • Editing script files

    编辑脚本文件
  • Creating new Python shells

    创建新的Python Shell
  • Debugging Python scripts

    调试Python脚本
Interactive Python Shell
Interactive Python Shell
交互式Python Shell

建立新档案 (Create New File)

Idle opens Python shell by default. The shell can be used simple scripts or test but for bigger projects, we should create a python script file and save our code to this file. We can create a script file from File->New File menu like below. After completing coding we should save the file with a related name.

空闲默认情况下会打开Python Shell。 可以使用简单的脚本或测试外壳,但是对于较大的项目,我们应该创建一个python脚本文件并将代码保存到该文件中。 我们可以从File-> New File菜单创建脚本文件,如下所示。 完成编码后,我们应该使用相关名称保存文件。

Create New File
Create New File
建立新档案

运行脚本文件(Run Script File)

We will use the following code to run. We will use F5 in order to run the following code. An alternative way to run is by clicking Run->Run Module from the menu.

我们将使用以下代码来运行。 我们将使用F5来运行以下代码。 另一种运行方式是从菜单中单击Run -> Run Module

age = input("Say your age:")

print("You are "+age+" years old")

This will open Idle shell window and run our script in the Python shell as we can see below.

这将打开Idle shell窗口,并在Python shell中运行脚本,如下所示。

Run Script File
Run Script File
运行脚本文件
LEARN MORE  How To Find Python Version?
了解更多如何查找Python版本?

翻译自: https://www.poftut.com/download-install-and-use-python-idle-editor/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值