Note | Python】的更多相关文章

目录 PyCharm+远程服务器 预备工作 Pycharm配置 list方法 os imageio Python Image Libarary (PIL) random time PyCharm+远程服务器 预备工作 PyCharm专业版,可以用教育邮箱激活. 远程服务器,ssh可联通,记录其ip. 远程服务器上有Python,针对深度学习任务最好有Anaconda. Pycharm配置 设置代码同步(PyCharm实际上会把代码传到服务器上运行):Tools -> Deployment ->…
//占位,缓缓写完 http://www.xuebuyuan.com/2117676.html 迭代器与生成器http://www.cnblogs.com/wilber2013/p/4652531.html https://github.com/lzjun567/note/blob/master/note/python/iterator_generator.md http://pyzh.readthedocs.org/en/latest/the-python-yield-keyword-expl…
一.概述 Python中内置了很多函数: 可以通过help().dir()方式查看函数的功能,使用内置函数通常效率更高 abs() abs函数接收一个数字对象,返回它的绝对值,如果接受的对象不是数字抛出TypeError异常 abs(...) abs(number) -> number Return the absolute value of the argument. help(abs) >>> abs(-1) 1 >>> abs(1) 1 >>&g…
#improt time module for count down puase time import time #set var for loop counting counter=1 #login setting while counter<=3: print('please enter username: ') username=input() print('please enter password: ') password=input() #dict for username and…
英文文档: open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None) Open file and return a corresponding file object. If the file cannot be opened, an OSError is raised. file is either a string or bytes objec…
一.Python代码缩进 Python 函数没有明显的  begin 和  end ,没有标明函数的开始和结束的花括号.唯一的分隔符是一个冒号 ( : ),接着代码本身是缩进的. 例如:缩进  buil dCon necti onStr ing 函数 def buildConnectionString(params): """Build a connection string from a dictionary of parameters. Returns string.&q…
英文文档: open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None) Open file and return a corresponding file object. If the file cannot be opened, an OSError is raised. file is either a string or bytes objec…
一.查询数据字典型数据 1.先说说dictionary查找和插入的速度极快,不会随着key的增加减慢速度,但是占用的内存大 2.list查找和插入的时间随着元素的增加而增加,但还是占用的空间小,内存浪费少 index modules | next | previous | Python » English French Japanese   dev (3.8) pre (3.7) 3.6.4 3.5 2.7  Documentation» The Python Standard Library …
add by zhj: 非常好的文章,异常在Python的核心代码中使用的非常广泛,超出一般人的想象,比如迭代器中,当我们用for遍历一个可迭代对象时, Python是如何判断遍历结束的呢?是使用的StopIteration异常,这点虽然大部分人知道,但如果是让你设计实现Python,我估计一般人不会这样 做.其实异常在Python中使用非常广泛,完全可以代替错误返回码,并不是说有异常不好,这点跟我之前的想法的确不一样,我以前认为异常只是用 来捕获的,很少去raise异常,但自己主动的去rais…
一:常量字符串 常量字符串用起来相对简单,也许最复杂的事情就是在代码中有如此多的方法来编写它们. eg:单引号:'spam"m'   , 双引号: “spa'm” , 三引号:‘’‘... spam ...'''或者 “”“... spam ...""". 转义字符:”s\tp\na\0m“ Raw字符串:r"C:\new\test.spm" Python3.0 中的Byte字符串:b'so\x01am' python2.6 中的Unicode字…