python 模塊包裹
[email protected]:~$ su root 密碼: [email protected]:/home/arlenmbx# pythonPython 2.7.10 (default, Oct 14 2015, 16:09:02) [GCC 5.2.1 20151010] on linux2 Type "help", "copyright", "credits" or "license" for more information.>>> dic={‘f1‘:1,‘f2‘:2,‘f3‘:3}>>> dic {‘f1‘: 1, ‘f2‘: 2, ‘f3‘: 3}>>> for key in dic: ... print dic[key] ... 1 2 3 >>> print dic.keys() [‘f1‘, ‘f2‘, ‘f3‘]>>> print dic.values() [1, 2, 3]>>> print dic.items() [(‘f1‘, 1), (‘f2‘, 2), (‘f3‘, 3)]>>> dic.clear()>>> print dic {}>>> type(dic)<type ‘dict‘> >>> f=open("a.py","r+") Traceback (most recent call last): File "<stdin>", line 1, in <module>IOError: [Errno 2] No such file or directory: ‘a.py‘>>> f=open("a.txt","r+") Traceback (most recent call last): File "<stdin>", line 1, in <module>IOError: [Errno 2] No such file or directory: ‘a.txt‘>>> f=open("/home/arlenmbx/桌面/pro.txt","r+")>>> f.write("hello world")>>> f.close()>>> chmod 755 python File "<stdin>", line 1 chmod 755 python ^SyntaxError: invalid syntax>>> exit() [email protected]