__init__.py 文件源码

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

项目:Verideals 作者: Derrreks 项目源码 文件源码
def in_idle():
    """
    @rtype: C{boolean}
    @return: true if this function is run within idle.  Tkinter
    programs that are run in idle should never call L{Tk.mainloop}; so
    this function should be used to gate all calls to C{Tk.mainloop}.

    @warning: This function works by checking C{sys.stdin}.  If the
    user has modified C{sys.stdin}, then it may return incorrect
    results.
    """
    import sys, types
    return (type(sys.stdin) == types.InstanceType and \
            sys.stdin.__class__.__name__ == 'PyShell')

##//////////////////////////////////////////////////////
##  Test code.
##//////////////////////////////////////////////////////
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号