pythontools--pycharminstallpycharm官网下载pycharm源码包,将源码包解压到指定位置。超级用户建议解压到/opt目录。普通用户建议解压到当前用户家目录,进入解压目录/opt/pycharm-community-2017.1.4/,Install-Linux-tar.txt详细介绍安装过程pycharm快捷键pycharm设置界面(ctrl+alt+s)修改菜单栏字体修改代码栏字体修改python解释器位置安装pycharm插件(eg:统计代码插件Statics)如何快速创建文件(alt+insert)格式化python代码制作样式好看(ctrl+alt+l)怎么修改指定函数的快捷键怎么撤销代码修改(ctrl+z)怎么撤销代码修改(ctrl+shift+z)快速重命名(shift+F6)快速注释代码(ctrl+/)快速取消注释代码(ctrl+/)Python内置数据类型包括数字和字符Strings、Bytes、Lists、Tuples、Dictionaries、Sets、Booleans等。数组存储相同数据类型的集合的总和。scores=[12,95.5]列表(类固醇数组)可以存储任何数据类型的总和,列表也可以嵌套在列表中。列表特征索引正向从0开始,反向从-1开始>>>services=['http','ftp','ssh']>>>services[0]'http'>>>services[-1]'ssh'sliceprint(services[::-1])#reverseofthelistprint(services[1:])#elementsexceptthefirstprint(services[:-1])#除了最后一个元素除了一个>>>services[::-1]['ssh','ftp','http']>>>services[1:]['ftp','ssh']>>>services[:-1]['http','ftp']connectservices1=['mysql','firewalld']print(services+services1)>>>services1=['network']>>>services1+services['network','http','ftp','ssh']重复print(services*3)>>services*2['http','ftp','ssh','http','ftp','ssh']member运算符|不在>>>servicesTrue中的'http'>>>servicesFalse中的'firewalld'嵌套列表services2=[['http',80],['ssh',22],['ftp',21]]index>>>services2[0][0]#forwardindex'http'>>>services2[-1][-1]#reverseindex21sliceprint(services2[:][1])#输出列表的第一位print(services2[:-1][0])#输出列表除最后一位外的第一个数字print(services2[0][:-1])#输出第一个数字如何在for循环中遍历服务名称print("ServiceDisplay".center(50,"*"))forserviceinservices:#打印输出不换行,print(service,end=',')>>>services=['http','ssh']>>>foriteminservices:...print(item)...httpsshpython2:打印不换行print"hello",python3:print("hello",end=',')
