Commits

<zho...@gmail.com  committed 6c9787b

添加my_helloworld

  • Participants
  • Parent commits 376e346

Comments (0)

Files changed (35)

File _vimrc

File contents unchanged.

File achieve/decorators_file.py

+# This is the exact equivalent to
+
+def a_name(fn):
+    def warpper():
+        return "<b>" + fn() + "</b>"
+    return warpper
+
+def b_name(fn):
+    def warpper():
+        return "<i>" + fn() + "</i>"
+    return warpper
+
+@a_name
+@b_name
+def say_hw():
+    return "Hello Kitty"
+print say_hw()

File achieve/diveintopythonzh48_hw.py

+import time
+
+def hello(world_name = ("Name!", "World!", "Kitty!"), ):
+    '''This Is My First Python's hello world'''
+    my_params = {"h1":"World: Hi ", "h2":"World: Hello: "}
+    if type(world_name) is []:
+        print my_params['h2'] + world_name[-1],
+    else:
+        world_name = list(world_name)
+        getattr(world_name, "append")("man")
+        print my_params['h1'] + world_name[-1],
+	
+if __name__ == "__main__":
+    hello()
+    time.sleep(0.613337)
+    print "\n\nyufei:",hello.__doc__ ,

File achieve/file_open_file.py

+#coding=utf-8
+#练习1: 用while循环、 函数定义、 try except、 open()等方法打开二进制文件并打印出来
+
+while True:
+    enter = "Please input your"
+    def sayHello():
+        name = raw_input(enter + " name:")
+        print "\nHello %s:" % name, "\nThe file does not exist, exiting"
+
+    filename = raw_input(enter + " filename:")
+    try:
+        f = open(filename,'rb')
+        for eachLine in f:
+            print eachLine
+    except IOError,e:
+        print sayHello()
+        print e,'\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n'
+    else:
+        f.close()
+        break

File achieve/logging_dir_file.py

+import logging as L
+
+def print_dir():
+    for attr in dir(L):
+        aa = getattr(L, attr)
+        bb = getattr(aa, '__doc__')
+        if bb:
+            print "================"
+            print attr, "\n"
+        else:
+            print "================"
+            print bb,"\n"
+print_dir()

File achieve/re_file.py

+import re
+
+a = re.search('0\d{2}-\d{8}', 'hi i am jimmy ,are you kitty? my tel phone: 010-88888888').group()
+a = re.search('^h.*(kitty\b)', 'hi i am jimmy ,are you kitty? my tel phone: 010-88888888').group()

File douban-book/douban-books-data.txt

File contents unchanged.

File douban-book/说明文档.txt

File contents unchanged.

File douban/.douban-book.py.swp

Binary file modified.

File douban/douban-book.py

File contents unchanged.

File douban/douban-python-0.4.1/PKG-INFO

File contents unchanged.

File douban/douban-python-0.4.1/RELEASE_NOTES.txt

File contents unchanged.

File douban/douban-python-0.4.1/build/lib.linux-i686-2.7/douban/__init__.py

File contents unchanged.

File douban/douban-python-0.4.1/build/lib.linux-i686-2.7/douban/client.py

File contents unchanged.

File douban/douban-python-0.4.1/build/lib.linux-i686-2.7/douban/oauth.py

File contents unchanged.

File douban/douban-python-0.4.1/build/lib.linux-i686-2.7/douban/service.py

File contents unchanged.

File douban/douban-python-0.4.1/dist/douban_python-0.4.1-py2.7.egg

Binary file modified.

File douban/douban-python-0.4.1/douban/__init__.py

File contents unchanged.

File douban/douban-python-0.4.1/douban/client.py

File contents unchanged.

File douban/douban-python-0.4.1/douban/oauth.py

File contents unchanged.

File douban/douban-python-0.4.1/douban/service.py

File contents unchanged.

File douban/douban-python-0.4.1/douban_python.egg-info/PKG-INFO

File contents unchanged.

File douban/douban-python-0.4.1/douban_python.egg-info/SOURCES.txt

File contents unchanged.

File douban/douban-python-0.4.1/douban_python.egg-info/dependency_links.txt

File contents unchanged.

File douban/douban-python-0.4.1/douban_python.egg-info/requires.txt

File contents unchanged.

File douban/douban-python-0.4.1/douban_python.egg-info/top_level.txt

File contents unchanged.

File douban/douban-python-0.4.1/examples/demo.py

File contents unchanged.

File douban/douban-python-0.4.1/setup.cfg

File contents unchanged.

File douban/douban-python-0.4.1/setup.py

File contents unchanged.

File douban/douban-python-0.4.1/tests/test_douban.py

File contents unchanged.

File douban/douban-python-0.4.1/tests/test_service.py

File contents unchanged.

File douban/douban-python-0.4.1/tests/testdata.py

File contents unchanged.

File vimrc

File contents unchanged.

File 爬虫/hello_fetch.py

File contents unchanged.

File 爬虫/hello_parse.py

File contents unchanged.