python基础:python语言特点(2)

python语言及特点

介绍

Python是一款易于学习且功能强大的编程语言。它具有高效率的数据结构,能够简单又有效的实现面向对象编程。
Python简洁的语法与动态输入的特性,加上其解释性语言的本质,使得它成为一种在多种领域与绝大多数平台都能进行脚本编写与应用快速开发工作的理想语言

特点

简单,易于学习,自由且开放,跨平台,可嵌入性,丰富的库

应用

常规的软件开发
科学计算
自动化运维
云计算
WEB开发
网络爬虫
数据分析
人工智能

Python之禅

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.
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.
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!

Hello World

学习编程语言当然少不了‘hello world,作为每个编程语言都受欢迎的一段代码,Python也是必不少的

print('hello world')
# 打印结果
->> hello world

不同于其他编程语言,python可谓是相当精简了

Pycharm

官网:http://www.jetbrains.com

其他编程语言,python可谓是相当精简了

Pycharm

官网:http://www.jetbrains.com
python基础:python语言特点(2)_第1张图片
下边附上一些简单的Pycharm配置步骤:

1.主题的修改 File-settings-apperance-theme
2.代码字体(控制台)的修改 File-settings-Editer-Font
3.关闭更新 File-settings-Appearance Behavior-System Settings-Updates
4.快捷键的修改 File-settings-Keymap
5.添加api文档悬浮提示 File-settings-Editer-General
6.自动导包 File-settings-Editer-General-Auto Import
7.禁止自动打开上次工程 File-settings-Appearance Behavior-System
Settings
8.添加头部文件 Editer-Code Style- File and Code Templates
9.修改字体编码 Editer-Code Style- File Encodings

设置头部注释

对于我们个人编写的代码文件,我习惯于加上一些注释信息,便于以后查找,当然,对于我们自己,也是每天的成果积累,下面我们来看一下新建py文件如何自动添加头部注释。
python基础:python语言特点(2)_第2张图片
注释代码

# -*- encoding: utf-8 -*-
"""
@File    : ${NAME}.py
@Time    : ${DATE} ${TIME}
@Author  : XXX
@Software: ${PRODUCT_NAME}
"""

总结:工欲善其事,必先利其器。至此,我们学习python这门编程语言的基础环境及工具基本准备完成。通过对工具的设置,提高开发舒适度,同时从细节慢慢积累,便于以后能更好的打牢基础。从第一个程序“hello world”,让我们打开变成世界的大门,开始python 编程之路。

你可能感兴趣的:(python基础)