2016年1月24日

对于python,一切事物都是对象,对象基于类创建

摘要: 新建列表、新建string字符串 1 li1 = [1, 2, 3, 4] 2 li2 = list([1, 2, 3]) 3 4 s1 = "abc" 5 s2 = str("abc") 6 7 print(li1) 8 print(type(li1)) 9 10 print(li2)11 1... 阅读全文

posted @ 2016-01-24 18:58 林肯公园 阅读(506) 评论(0) 推荐(0)

python主文件判断

摘要: 目录结构:myfile1.py、myfile2.py、myfile3.py代码都是打印文件名和__name__变量,如myfile1.py:1 print("myfile1",__name__)index.py import导入上面三个文件并打印__name__变量,代码如下:1 import my... 阅读全文

posted @ 2016-01-24 18:12 林肯公园 阅读(1178) 评论(0) 推荐(0)

导航