python 模組包裹

來源:互聯網
上載者:User

標籤:default   密碼   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 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/案頭/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: 無法訪問"b.py": 沒有那個檔案或目錄[email protected]:/home/arlenmbx# cd /home/arlenmbx/案頭[email protected]:/home/arlenmbx/案頭# dira.py  a.py~  b.py  b.py~  pro.txt[email protected]:/home/arlenmbx/案頭# chmod 755 [email protected]:/home/arlenmbx/案頭# ./b.pyhhahhahhahhahhahhahhahhahhahha[email protected]:/home/arlenmbx/案頭# import b as bb程式 ‘import‘ 已包含在下列軟體包中: * imagemagick * graphicsmagick-imagemagick-compat請嘗試:apt-get install <選定的軟體包>[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.>>> def f(a,b,c):...     print a...     print b...     print c... >>> f(1,2,3)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)(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... >>> fun1(1,2,)Traceback (most recent call last):  File "<stdin>", line 1, in <module>TypeError: fun1() takes exactly 0 arguments (2 given)>>> fun1(1,2,3)Traceback (most recent call last):  File "<stdin>", line 1, in <module>TypeError: 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="複製代碼" style="margin:0px;padding:0px;border:none;" />


python 模組包裹

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.