V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
oldcai
V2EX  ›  Python

Python 设计模式,代码示例+在线得出运行结果

  •  1
     
  •   oldcai ·
    oldcai · 2014-07-12 02:46:50 +08:00 · 4097 次点击
    这是一个创建于 3593 天前的主题,其中的信息可能已经有所发展或是发生改变。
    No 模式名(中文) 模式名(英文)
    1 抽象工厂模式 abstract_factory
    2 适配器模式 adapter
    3 共享模式 borg
    4 桥接模式 bridge
    5 建造者模式 builder
    6 职责链模式 chain
    7 命令模式 command
    8 组合模式 composite
    9 装饰模式 decorator
    10 外观模式 facade
    11 工厂模式 factory_method
    12 享元模式 flyweight
    13 图搜索模式 graph_search
    14 迭代器模式 iterator
    15 中介模式 mediator
    16 备忘录模式 memento
    17 空模式 null
    18 观察者模式 observer
    19 连接池模式 pool
    20 原型模式 prototype
    21 代理模式 proxy
    22 状态模式 state
    23 策略模式 strategy
    24 模板方法模式 template
    25 访问者模式 visitor

    http://pythontip.sinaapp.com/pythonPatterns/
    5 条回复    2014-07-17 23:05:08 +08:00
    a2z
        1
    a2z  
       2014-07-12 11:25:34 +08:00
    活生生的远程代码执行啊,不知道沙盒做的怎么样
    allan888
        2
    allan888  
       2014-07-12 11:28:25 +08:00
    真的很棒!我现在在用C实现一遍数据结构和算法。
    等C做完了再用python试试~
    huanglk
        3
    huanglk  
       2014-07-12 11:46:56 +08:00
    很丰富的资源,赞!
    eb0c6551
        4
    eb0c6551  
       2014-07-12 13:58:23 +08:00
    希望代码可以换配色方案
    xingzhi
        5
    xingzhi  
       2014-07-17 23:05:08 +08:00
    确实做得不错。

    ```
    print open('/data1/www/htdocs/841/yunmei/2/password').read()

    out:
    哈哈,被骗了吧!!!!!
    好好学python,没事别瞎搞!!!!
    author: zihuacs

    ```
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3622 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 00:14 · PVG 08:14 · LAX 17:14 · JFK 20:14
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.