---
title: "代码笔记"
author: "华天下"
date: "2011-10-16T09:41:32Z"
tags: []
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2011-10-16T14:02:03Z"
id: 1197642
url: "https://czh.iteye.com/blog/1197642"
---

```python
def _resolve(name):
    """将字符串转为对象"""
    """Resolve a dotted name to a global object."""
    name = name.split('.')
    used = name.pop(0)
    found = __import__(used)
    for n in name:
        used = used + '.' + n
        try:
            found = getattr(found, n)
        except AttributeError:
            __import__(used)
            found = getattr(found, n)
    return found
```




```java
def _strip_spaces(alist):
    """去除列表里的字符串的空格"""
    return map(lambda x: x.strip(), alist)
```