This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| __author__ = 'tim' | |
| fruits = [ | |
| 'apple', 'pineapple', | |
| 'apple', 'pineapple', | |
| 'apple', 'pineapple', | |
| ] | |
| counter = {} | |
| for fruit in fruits: | |
| if fruit in counter: | |
| counter[fruit] +=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| __author__ = 'tim' | |
| fruits = [ | |
| 'apple', 'pineapple', | |
| 'apple', 'pineapple', | |
| 'apple', 'pineapple', | |
| ] | |
| counter = {} | |
| for fruit in fruits: | |
| if fruit in counter: | |
| counter[fruit] +=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| __author__ = 'tim' | |
| def a_lot_exception(a,b): | |
| try: | |
| x = 3/a | |
| y = int(b,8) | |
| return x + y | |
| except ZeroDivisionError: | |
| return 0 | |
| except ValueError: | |
| return x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| __author__ = 'tim' | |
| def read_content(name): # just print an message indicate error | |
| ''' | |
| it is of if the file is not exist | |
| ''' | |
| try: | |
| fs = open(name) | |
| print "coder after error will not printed" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| __author__ = 'tim' | |
| fruits = [ | |
| 'apple', 'pineapple', | |
| 'apple', 'pineapple', | |
| 'apple', 'pineapple', | |
| ] | |
| counter = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| __author__ = 'tim' | |
| def is_even_number(number): | |
| return number % 2 == 0 | |
| is_even_number('2') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import print_function | |
| import threading | |
| import time | |
| ending = False | |
| def response(): | |
| while not ending: | |
| print('.') | |
| time.sleep(1) | |
| def fib(num): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from scrapy.spider import BaseSpider | |
| from scrapy.selector import HtmlXPathSelector | |
| from ..items import WikiItem | |
| from scrapy.http import Request | |
| import urlparse | |
| class DmozSpider(BaseSpider): | |
| name = "wiki" | |
| allowed_domains = ["wikipedia.org"] | |
| start_urls = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 0 errors found | |
| Django version 1.4.2, using settings 'opass.settings' | |
| Development server is running at http://0.0.0.0:8000/ | |
| Quit the server with CONTROL-C. | |
| Method: POST | |
| Path: / | |
| Data: Action=GetSendQuota | |
| Headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'} | |
| Host: email.us-east-1.amazonaws.com | |
| establishing HTTPS connection: host=email.us-east-1.amazonaws.com, kwargs={} |
NewerOlder