Python 快进
快进 就不纠结细节
# 单行注释
'''
多行注释
123
'''
空格缩进 缩进保持一致
声明变量 a = 123 删除 del a 输出 print(a)
导入模块 import
从模块导入函数 from 模块 import 函数,函数...
连接符+用加号
list与js数组很像 方法也接近 tuple类似list但非list,dict值不可改变
dict 就是 json set集合可做& | + 运算
class ttt:
a = 123
__b = "私有属性"
def __init__(self, a, b): #初始化函数
self.a = a
self.__b = b
def xxx(self):
print(self.a, self.__b)
#__del__ 析构
#实例化
x = ttt(1,2)
x.xxx() #输出 1 2
安装pip
我的python版本使用的是python3.8 embeddable版 Windows x86-64 embeddable zip file
下载get-pip.py到python目录
python目录下python38._pth文件 # import site 把 # 去掉
然后命令行运行 python get-pip.py
将 Scripts 下pip.exe加入环境变量
安装numpy
命令行 pip install numpy
安装pandas
.......卡住
网友评论