- 得到下标用for迭代
for i, char in enumerate("haha"): print(i, char[i])
- pip2 和 pip3共存
pyhon2 -m pip install xxx
- 多字符分隔
import re s = 'as,as;asd.asd' res = re.split('[,;.]*', s)
- configparser (python3)
config = configparser.ConfigParser(interpolation=configparser.ExtendedInterpolation()) config.read('example.ini') config.sections() value = config['section']['key']
读取配置文件
[TICKscript1] script = "house1.tick" task = "house1" type = "stream" database = "house" retention_policy = "default" test = ${script} test2 = ${influxdb:hh}
- 函数参数
```
def test(*a):
print(a)
test(1, 2) a = (1, 2)
def test2(**)
* end
builtins.end = None
* anaconda
conda create –name tf_test python=3.6 source activate tf_test
* future
```python
from __future__ import division 之后:
23/6 # 得 3.8333333333333335
- 在虚拟环境中添加juypter kenerl
source activate tf_test pip install ipykernel python -m ipykernel install --user --name=new_kenerl_name # juypter notebook # 在juypter notebook中选择Kenerl