pythonhelpers.cpp

来自「这是书籍Premier.Press.MUD.GAME.PROGRAMMING.r」· C++ 代码 · 共 32 行

CPP
32
字号
// MUD Programming
// Ron Penton
// (C)2003
// PythonHelpers.cpp - This file has several helper functions for use with
//                     python scripts.
// 
// 


#include "PythonHelpers.h"

namespace BetterMUD
{


std::string PythonObject::GetNameOfClass()
{
    PythonObject cls = PyObject_GetAttrString( m_object, "__class__" );
    PythonObject name = PyObject_GetAttrString( cls.get(), "__name__" );
    return StringFromPy( name );
}

std::string PythonObject::GetName()
{
    PythonObject name = PyObject_GetAttrString( m_object, "__name__" );
    return StringFromPy( name );
}


}   // end namespace BetterMUD

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?