我在Windows 7上.我安装了Python 2.7多年.我最近安装了Python 3.4.我正在尝试使用新的py启动器.当我打开cmd终端并输入时py -2,我收到以下错误消息:Requested Python version (2) not installed.如何让py知道我的python 2.7安装?
注意:如果出现问题,python 2.7安装在非标准目录(不在C:\ Python27中)中.
我想测试以下代码
import weakref
class WeakBoundMethod:
"""
Wrapper around a method bound to a class instance. As opposed to bare
bound methods, it holds only a weak reference to the `self` object,
allowing it to be deleted.
This can be useful when implementing certain kinds of systems that
manage callback functions, such as an event manager.
"""
def __init__(self, meth):
"""
Initializes the class instance. It should be ensured that methods
passed through the `meth` parameter are always bound methods. Static …Run Code Online (Sandbox Code Playgroud)