當前位置: 首頁>>代碼示例>>Python>>正文


Python machinery.__name__方法代碼示例

本文整理匯總了Python中importlib.machinery.__name__方法的典型用法代碼示例。如果您正苦於以下問題:Python machinery.__name__方法的具體用法?Python machinery.__name__怎麽用?Python machinery.__name__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在importlib.machinery的用法示例。


在下文中一共展示了machinery.__name__方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __repr__

# 需要導入模塊: from importlib import machinery [as 別名]
# 或者: from importlib.machinery import __name__ [as 別名]
def __repr__(self):
        return self.__class__.__name__ + repr(self.args) 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:4,代碼來源:__init__.py

示例2: run_script

# 需要導入模塊: from importlib import machinery [as 別名]
# 或者: from importlib.machinery import __name__ [as 別名]
def run_script(dist_spec, script_name):
    """Locate distribution `dist_spec` and run its `script_name` script"""
    ns = sys._getframe(1).f_globals
    name = ns['__name__']
    ns.clear()
    ns['__name__'] = name
    require(dist_spec)[0].run_script(script_name, ns)


# backward compatibility 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:12,代碼來源:__init__.py

示例3: resolve

# 需要導入模塊: from importlib import machinery [as 別名]
# 或者: from importlib.machinery import __name__ [as 別名]
def resolve(self):
        """
        Resolve the entry point from its module and attrs.
        """
        module = __import__(self.module_name, fromlist=['__name__'], level=0)
        try:
            return functools.reduce(getattr, self.attrs, module)
        except AttributeError as exc:
            raise ImportError(str(exc)) 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:11,代碼來源:__init__.py

示例4: __repr__

# 需要導入模塊: from importlib import machinery [as 別名]
# 或者: from importlib.machinery import __name__ [as 別名]
def __repr__(self):
        return self.__class__.__name__+repr(self.args) 
開發者ID:jpush,項目名稱:jbox,代碼行數:4,代碼來源:__init__.py

示例5: run_script

# 需要導入模塊: from importlib import machinery [as 別名]
# 或者: from importlib.machinery import __name__ [as 別名]
def run_script(dist_spec, script_name):
    """Locate distribution `dist_spec` and run its `script_name` script"""
    ns = sys._getframe(1).f_globals
    name = ns['__name__']
    ns.clear()
    ns['__name__'] = name
    require(dist_spec)[0].run_script(script_name, ns)

# backward compatibility 
開發者ID:jpush,項目名稱:jbox,代碼行數:11,代碼來源:__init__.py

示例6: run_script

# 需要導入模塊: from importlib import machinery [as 別名]
# 或者: from importlib.machinery import __name__ [as 別名]
def run_script(self, requires, script_name):
        """Locate distribution for `requires` and run `script_name` script"""
        ns = sys._getframe(1).f_globals
        name = ns['__name__']
        ns.clear()
        ns['__name__'] = name
        self.require(requires)[0].run_script(script_name, ns) 
開發者ID:sofia-netsurv,項目名稱:python-netsurv,代碼行數:9,代碼來源:__init__.py


注:本文中的importlib.machinery.__name__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。