[Email protected]:~$ su root password: [email protected]-thinkpad-x130e:/home/arlenmbx#pythonPython 2.7.10 (default, Oct 14 2015, 16:09:02) [GCC5.2.1 20151010] on Linux2type" Help","Copyright","credits" or "License" forMore information.>>> dic={'F1': 1,'F2': 2,'f3': 3}>>>dic{'F1': 1,'F2': 2,'f3': 3}>>> forKeyinchdic: ...PrintDic[key] ...123>>>PrintDic.keys () ['F1','F2','f3']>>>Printdic.values () [1, 2, 3]>>>PrintDic.items () [('F1', 1), ('F2', 2), ('f3', 3)]>>>dic.clear ()>>>Printdic{}>>>type (DIC)<type'Dict'>>>> F=open ("a.py","r+") Traceback (most recent): File"<stdin>", Line 1,inch<module>IOError: [Errno2] No such fileorDirectory'a.py'>>> F=open ("a.txt","r+") Traceback (most recent): File"<stdin>", Line 1,inch<module>IOError: [Errno2] No such fileorDirectory'a.txt'>>> F=open ("/home/arlenmbx/Desktop/pro.txt","r+")>>> F.write ("Hello World")>>>f.close ()>>> chmod 755python File"<stdin>", Line 1chmod755python^syntaxerror:invalid Syntax>>>exit () [email protected]-thinkpad-x130e:/home/arlenmbx#chmod 755 b.pyCHMOD: Unable to access"b.py": No file or directory [email protected]-thinkpad-x130e:/home/arlenmbx#cd/home/arlenmbx/Desktop[Email protected]:/home/arlenmbx/Desktop#dira.py a.py~ b.py b.py~Pro.txt[email protected]-thinkpad-x130e:/home/arlenmbx/Desktop#chmod 755 b.py[Email protected]:/home/arlenmbx/Desktop#./b.pyHhahhahhahhahhahhahhahhahhahha[email protected]-thinkpad-x130e:/home/arlenmbx/Desktop#import B as BBProgram'Import'is included in the following packages:*ImageMagick* graphicsmagick-imagemagick-compat Please try: Apt-get Install < selected packages >[email protected]-thinkpad-x130e:/home/arlenmbx/Desktop#pythonPython 2.7.10 (default, Oct 14 2015, 16:09:02) [GCC5.2.1 20151010] on Linux2type" Help","Copyright","credits" or "License" forMore information.>>>deff (a,b,c): ...Printa ... ..Printb .....Printc ...>>> F (A)123>>> F (a=3,b=2,c=1)321>>>Print(c=1,b=3,a=2) File"<stdin>", Line 1Print(c=1,b=3,a=2) ^syntaxerror:invalid Syntax>>> F (c=1,b=3,a=2)231>>>defFun (*p): .... Type (p) ...Printp ...>>> Fun (A)(1, 2, 3)>>>defFun (*p): ... ..Printtype (p) ...Printp ... fun (1,2,3,4) File"<stdin>", line 4Fun (1,2,3,4) ^syntaxerror:invalid Syntax>>> Fun (1,2,3,4)(1, 2, 3, 4)>>> Fun (1,2,4,3,4,5)(1, 2, 4, 3, 4, 5)>>>defFUN1 (* *p): ... ..Printtype (p) ...Printp ...>>> Fun1 (,) Traceback (most recent): File"<stdin>", Line 1,inch<module>typeerror:fun1 () takes exactly 0 arguments (2given)>>> Fun1 (A) Traceback (most recent): File"<stdin>", Line 1,inch<module>typeerror:fun1 () takes exactly 0 arguments (3given)>>> Fun1 (a=1,b=2)<type'Dict'>{'a': 1,'b': 2}>>> >>>deffun2 (a,b,c): ...Printa ... ..Printb .....Printc ...>>> t= (3,4,5)>>> fun2 (*t)345>>>
Python Module Package