OSC.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:chuck 作者: Calysto 项目源码 文件源码
def parseArgs(args):
    """Given a list of strings, produces a list
    where those strings have been parsed (where
    possible) as floats or integers."""
    parsed = []
    for arg in args:
        print(arg)
        arg = arg.strip()
        interpretation = None
        try:
            interpretation = float(arg)
            if string.find(arg, ".") == -1:
                interpretation = int(interpretation)
        except:
            # Oh - it was a string.
            interpretation = arg
            pass
        parsed.append(interpretation)
    return parsed
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号