2.1 The Python Interpreter(python解释器)
2.1 The Python Interpreter(Python解释器)
Python是一门解释性语言。Python的解释器一次只能运行一个命令。标准的Python解释器环境可以用通过输入python进入(在终端输入python后,就能进入解释器):

>>>是提示符(prompt),告诉你可以输入指令。如果想要退出,可以输入exit()或者按Ctrl-D。
运行python程序也很简单,输入一个终端python+.py文件即可。假设我们的hello_world.py文件中有下面的内容
print('Hello world')
可以通过下面的命令来运行(记住,hello_world.py必须在当前文件夹下):

如果是做科学计算和数据分析的话,我们通常使用IPython,这是一个强化版的python解释器,而Jupyter notebook是一个基于网页的代码记事本,也是从IPython项目中开发出来的。这里会简单介绍一下IPython和Jupyter和使用方法,更多的内容可以看附录B。当我们使用%run命令的时候,IPython会按执行代码的方式来执行文件,可以让我们直观地看到交互的结果:

默认的IPython提示符会显示数字,比如图片中的In [2]:,而不是普通的>>>提示符。
2.1 The Python Interpreter(python解释器)的更多相关文章
- [Python] Interpreter setting in Pycharm
From: http://blog.csdn.net/u013088062/article/details/50135135 From: http://blog.csdn.net/u013088062 ...
- 首次安装Pycharm出现No Python interpreter selected解决方法
刚装完Pycharm,新建Project的时候,出现了No Python interpreter selected.网上的教程里path interpret栏里应该选中python.exe,但是我搜遍 ...
- [译]Python编写虚拟解释器
使用Python编写虚拟机解释器 一.实验说明 1. 环境登录 无需密码自动登录,系统用户名shiyanlou,密码shiyanlou 2. 环境介绍 本实验环境采用带桌面的Ubuntu Linux环 ...
- "No Python interpreter configured for the project " in Pycharm for python selenium
自动化测试问题: pyCharm提示python Interpreter没有设置,点击configure Python Interpreter,进入Settings 在 Project Interpr ...
- 解决初次安装PyCharm后 No Python interpreter selected的问题
原文链接:https://liuzhichao.com/p/1543.html PyCharm 是由JetBrains打造的一款 Python IDE.具有智能代码编辑器,能理解 Python 的特性 ...
- 【python系列】安装完PyCharm创建项目提示No Python interpreter selected
安装Python解释器 去python官网下载python的安装包(https://www.python.org/downloads/release/python-361/) 注意安装的时候选择配置p ...
- pycharm中选择python interpreter
pycharm中选择python interpreter pycharm中有两处地方需要选择python解释器: 一处是调试配置(edit configurations)处,这里选择python解释器 ...
- Python Interpreter
在开始之前,我们先限定下python解释器的意思.当讨论Python的时候,解释器这个词可以用在不同的地方.有的时候,解释器指的是Python Interpreter,也就是你在命令行交互界面上输入p ...
- [译]The Python Tutorial#2. Using the Python Interpreter
[译]The Python Tutorial#Using the Python Interpreter 2.1 Invoking the Interpreter Python解释器通常安装在目标机器的 ...
随机推荐
- C# 数组中的 indexOf 方法
var array=['REG','2018','2018']; array.indexOf(‘REG’) // 0 array.indexOf(‘R’) // -1 array.indexOf(’2 ...
- 在SQLSERVER中如何检测一个字符串中是否包含另一个字符串
--当charindex返回值大于0时则包含 为0不包含 select CHARINDEX('456','123456') SQL语句使用CHARINDEX函数,来测试一个字符串中是否包含另一个字 ...
- Spark of work
Today I attended a meeting of reviewing code, and I learned a lot from it. In the discuss, we found ...
- linq中order by 和group by (含lambda表达式实现)以及综合案例
一.Linq应用场景 linq的语法通过System.Linq下面的Enumerable类提供支持,也就是说,只要是实现了IEnumerable<T>的对象都可以使用Linq的语法来查询. ...
- element-ui中使用font-awesome字体图标
element-ui提供的字体图标是很少的,所以我们需要集成其它图标来使用,nodejs的集成官方有说明,这里说明一下非nodejs开发集成图标 首先下载fontawesome,需要更改里面图标前缀, ...
- app判断链接参数后缀跳转不同地址
http://testhf.irongbei.com/DoubleAct/index?from=app <?php $urlp = (isset($_GET['from']) && ...
- Jquery全选系列操作(锋利的jQuery)
Jquery全选系列操作(锋利的jQuery) <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" ...
- Android UI组件----自定义ListView实现动态刷新
[声明] 欢迎转载,但请保留文章原始出处→_→ 生命壹号:http://www.cnblogs.com/smyhvae/ 文章来源:http://www.cnblogs.com/smyhvae/p/3 ...
- leetCode题解 寻找运动环
1.题目描述 Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this ...
- Swiper-轮播图。
Swiper(Swiper master)是目前应用较广泛的移动端网页触摸内容滑动js插件,可以用来做轮播和滑动. 初始化 <!DOCTYPE html> <html> < ...