您现在的位置: 万盛学电脑网 >> 程序编程 >> 网络编程 >> 编程语言综合 >> 正文

python中查看变量内存地址的方法

作者:佚名    责任编辑:admin    更新时间:2022-06-22

   这篇文章主要介绍了python中查看变量内存地址的方法,涉及Python中id使用技巧,需要的朋友可以参考下

  本文实例讲述了python中查看变量内存地址的方法。分享给大家供大家参考。具体实现方法如下:

  这里可以使用id

  ?

1 2 3 4 5 >>> print id.__doc__ id(object) -> integer Return the identity of an object. This is guaranteed to be unique among simultaneously existing objects. (Hint: it's the object's memory address.) >>>

  希望本文所述对大家的Python程序设计有所帮助。