Python Module Package

Source: Internet
Author: User

Tag:default    password    python   

[Email protected]:~$ su root Password:  [email protected]:/home/arlenmbx# pythonpython  2.7.10  (default, oct 14 2015, 16:09:02)  [gcc 5.2.1 20151010]  on linux2Type  "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]... 123>>> 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/desktop/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]:/home/arlenmbx# chmod 755 b.pychmod:  cannot access "b.py":  there is no file or directory [email  Protected]:/home/arlenmbx# cd /home/arlenmbx/Desktop [email protected]:/home/arlenmbx/desktop # dira.py  a.py~   b.py  b.py~  pro.txt[email protected]:/home/arlenmbx/Desktop # chmod  755 [email protected]:/home/arlenmbx/Desktop # ./b.pyhhahhahhahhahhahhahhahhahhahha[email  protected]:/home/arlenmbx/Desktop # import b as bb program   ' Import '   is included in the following packages: *  Imagemagick * graphicsmagick-imagemagick-compat try:apt-get install < the selected package >[email  protected]:/home/arlenmbx/Desktop # pythonpython 2.7.10  (default, oct 14 2015,  16:09:02)  [GCC 5.2.1 20151010] on linux2Type  "Help",  "copyright",   "Credits"  or  "License"  for more information.>>> def f (A,B,C) :...     print a...     print b...      print c..  >>> f (123>>> f) (a=3,b=2,c=1) 321>>> print (c=1,b=3,a=2)   File  "<stdin>",  line 1    print (c=1,b=3,a=2)             ^SyntaxError: invalid syntax>>>  F (c=1,b=3,a=2) 231>>> def fun (*p): ...      type (p) ...      print p... >>> fun (1, 2, 3) >>> def  fun (*p): ...      print type (p) ...      print p ...  fun (1,2,3,4)   File  "<stdin>",  line 4    fun ( 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) >>> def fun1 (**p): ...      print type (p) ...      print p ... &NBSP;&GT;&GT;&GT;&NBSP;FUN1 (traceback ) (most recent call last):  File  "<stdin>",  line 1, in <module>typeerror: fun1 ()  takes exactly  0 arguments  (2 given) >>> fun1 (traceback ) (most recent  Call last):  file  "<stdin>",  line 1, in <module>typeerror: &NBSP;FUN1 ()  takes exactly 0 arguments  (3 given) >>> fun1 (a=1,b=2) <type  ' dict ' >{' a ': 1,  ' B ':  2}>>> >>> def fun2 (a,b,c ):...     print a...     print b...      print c... >>> t= (3,4,5) >>> fun2 (*t) 345>>>

650) this.width=650; "src="/img/fz.gif "alt=" Copy Code "style=" Margin:0px;padding:0px;border:none; "/>


Python Module Package

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.