__init__.py 文件源码

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

项目:py2rb 作者: naitoh 项目源码 文件源码
def convert_py2rb(s, path='', base_path_count=0, modules=[], mod_paths={}):
    """
    Takes Python code as a string 's' and converts this to Ruby.

    Example:

    >>> convert_py2rb("x[3:]")
    'x[3..-1]'

    """
    v = RB(path, base_path_count, mod_paths)
    for m in modules:
        t = ast.parse(m)
        v.visit(t)
    v.clear()
    t = ast.parse(s)
    v.visit(t)
    return v.read()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号