美文网首页
初识Python和环境搭建

初识Python和环境搭建

作者: kris_lp | 来源:发表于2018-03-03 14:29 被阅读0次

python之禅

  • 操作

1.在 jupyter中输入import this

  • 内容及解释:

The Zen of Python, by Tim Peters

Beautiful is better than ugly.
优美胜于丑陋
Explicit is better than implicit.
明确胜于模糊
Simple is better than complex.
简单胜于复杂
Complex is better than complicated.
复杂胜于混乱
Flat is better than nested.
扁平胜于嵌套
Sparse is better than dense.
稀疏胜于稠密
Readability counts.
可读性很重要
Special cases aren't special enough to break the rules.
Although practicality beats purity.
即便假借特例的实用性之名,也不可违背这些规则(这些规则至高无上)
Errors should never pass silently.
Unless explicitly silenced.
不要包容所有错误,除非你确定需要这样做(精准地捕获异常,不写except:pass风格的代码)
In the face of ambiguity, refuse the temptation to guess.
当存在多种可能,不要尝试去猜测
There should be one-- and preferably only one --obvious way to do it.
而是尽量找一种,最好是唯一一种明显的解决方案(如果不确定,就用穷举法)
Although that way may not be obvious at first unless you're Dutch.
虽然这并不容易,因为你不是 Python 之父(这里的Dutch是指
Now is better than never.
Although never is often better than *right* now.
做也许好过不做,但不假思索就动手还不如不做(动手之前要仔细思量)
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
如果你无法向人描述你的方案,那肯定不是一个好方案;反之亦然(方案测评标准)
Namespaces are one honking great idea -- let's do more of those!
名称空间是一个非常好的主意--让我们来做更多的事情吧!

搭建Python环境

1.在Python官方网站下载对应版本的python安装程序(exe文件),安装时建议勾选“Add Python 3.6 to PATH”(将Python 3.6添加到PATH环境变量),并且将“pip”、“tcl/tk”、“Python test suite”等项全部勾选上。

注意:在Windows 7环境下安装时,需要先安装Service Pack 1补丁包(可以通过一些工具软件自动安装系统补丁的功能来安装)


从终端运行Python

打开命令提示符:win+r >> cmd

  • 确认python版本

方法一:
python --version
方法二:
import sys
print(sys.version_info)
print(sys.version)

  • 运行python程序

python hello.py


jupyter

  • 安装环境

1.win+r >> cmd
2.python _m pip install ipython jupyter

  • 使用jupyter

1.win+r >> cmd
2.jupyter notebook


PyCharm

1.首先要有java运行环境,这个环境要安装在C盘
2.在PyCharm官方网站下载安装包,安装时勾选64-bit,Do not import…
3.激活:需要激活码,lanyu提供免费激活码,但PyCharm每次会自动验证注册码,而注册码是动态的,那么用户每次使用时,都需要重新生成激活码,为了用户使用方便,我们可自行屏蔽验证注册码的网站,方法如下:
a.找到hosts文件,路径:C:\windows\system32\drivers\etc
b.在hosts文件中加入 代码:0.0.0.0 account.jetbrains.com

相关文章

  • 初识Python和环境搭建

    python之禅 操作 1.在 jupyter中输入import this 内容及解释: 搭建Python环境 1...

  • 初识python(环境搭建)

    1、官网下载https://www.python.org/downloads/ windows系统: 选择文件进行...

  • 初识Java

    1 初识Java 目录 1 初识Java1.1 概述1.2 特点1.3 环境搭建与开发工具1.3.1 环境搭建1....

  • Python自学笔记Day2

    Python自学笔记——Day2 Python环境搭建 1. Python环境搭建 所需软件Python解释器Py...

  • selenium自动化测试

    一.自动化选型 二.selenium环境搭建(以python示例) python环境搭建下载python安装验证 ...

  • Python学习--环境搭建

    Python学习入门--环境搭建 Python简介 在进行Python环境搭建之前 ,先简单的介绍一下Python...

  • Python基础

    一、搭建编程环境 在Windows系统中搭建Python编程环境 安装Pythonhttp://python.or...

  • python selenium2 开发环境搭建

    环境搭建 基于python和selenium2做自动化测试,你必须会搭建基本的开发环境,掌握python基本的语法...

  • Ubuntu 14.04下Django&MySQL环境部

    Python环境搭建## 操作系统Ubuntu14.04,自带Python2.7.6 Django环境搭建## 目...

  • Python学习一之开发环境搭建

    一、搭建Python开发环境 环境准备 win10 自备 idea idea安装传送阵 Python开发环境搭建步...

网友评论

      本文标题:初识Python和环境搭建

      本文链接:https://www.haomeiwen.com/subject/prjtfftx.html