Skip to main content

alfred westerveld's Library tagged python   View Popular

31 Oct 09

Merging Dictionary - Python

    • >>> d1 = {"a": "a1", "b": "b1"}
    • >>> d2 = {"c": "c1", "b": "b2"}
    • >>> d1.update(d2)
    • >>> d1
    • {'a': 'a1', 'c': 'c1', 'b': 'b2'}

App Engine Fan: Unit tests for Google App Engine apps

  • import unittest
    import sys
    import os.path


    # Change the following line to reflect wherever your
    # app engine installation and the mocker library are
    APPENGINE_PATH = '../google_appengine'
    MOCKER_PATH = '../mocker-0.10.1'


    # Add app-engine related libraries to your path
    paths = [
    APPENGINE_PATH,
    os.path.join(APPENGINE_PATH, 'lib', 'django'),
    os.path.join(APPENGINE_PATH, 'lib', 'webob'),
    os.path.join(APPENGINE_PATH, 'lib', 'yaml', 'lib'),
    MOCKER_PATH,
    ]
    for path in paths:
    if not os.path.exists(path):
    raise 'Path does not exist: %s' % path
    sys.path = paths + sys.path
    import mocker
1 - 20 of 81 Next › Last »
Showing 20 items per page

Highlighter, Sticky notes, Tagging, Groups and Network: integrated suite dramatically boosting research productivity. Learn more »

Join Diigo