![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
python programming
杯酒和雪
这个作者很懒,什么都没留下…
展开
-
python魔法方法__get_item__
在Python中我们可以使用__get__item__、__len__等方法去创建类似于序列和映射的类。这种方法的好处是可以像列表一样使用索引功能访问元素。 魔术方法的作用: getitem(self,key):返回键对应的值。 setitem(self,key,value):设置给定键的值 delitem(self,key):删除给定键对应的元素。 len():返回元素的数量 【注释】只要实现了...原创 2019-12-05 10:42:13 · 3118 阅读 · 0 评论 -
pip和anaconda换源
1. pip换源 pip换源需要修改文件~/.pip/pip.conf [global] index-url = http://mirrors.aliyun.com/pypi/simple/ trusted-host = mirrors.aliyun.com 2. Anaconda换源 换到国内源 conda config --add channels https://mirrors.tun...原创 2019-11-25 14:12:23 · 487 阅读 · 0 评论