zoukankan      html  css  js  c++  java
  • python __globals__, __file__

    Attribute Meaning  
    __doc__ The function’s documentation string, or None if unavailable; not inherited by subclasses Writable
    __name__ The function’s name Writable
    __qualname__

    The function’s qualified name

    New in version 3.3.

    Writable
    __module__ The name of the module the function was defined in, or None if unavailable. Writable
    __defaults__ A tuple containing default argument values for those arguments that have defaults, or None if no arguments have a default value Writable
    __code__ The code object representing the compiled function body. Writable
    __globals__ A reference to the dictionary that holds the function’s global variables — the global namespace of the module in which the function was defined. Read-only
    __dict__ The namespace supporting arbitrary function attributes. Writable
    __closure__ None or a tuple of cells that contain bindings for the function’s free variables. Read-only
    __annotations__ A dict containing annotations of parameters. The keys of the dict are the parameter names, and 'return' for the return annotation, if provided. Writable
    __kwdefaults__ A dict containing defaults for keyword-only parameters. Writable

    获取当前的代码所在的文件名

    __globals__['__file__']
    D:MARKNOTE emp.py

  • 相关阅读:
    深度学习中的基本概念——梯度相关
    模型训练中涉及到的技巧
    ubuntu swapfile
    ubuntu install opencv
    Jetson TX1 安装ROS操作系统
    Redis介绍以及安装(Linux)
    C# url信息获取
    贝茨视觉训练法
    PHP设计模式浅析
    MySQL相关知识
  • 原文地址:https://www.cnblogs.com/wancy86/p/6243725.html
Copyright © 2011-2022 走看看