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
在这里插入图片描述
下边附上一些简单的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文件如何自动添加头部注释。
在这里插入图片描述
注释代码

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

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值