Python打印行号JAY.LIN 收录于 Python 2024-12-16 约 35 字 预计阅读 1 分钟 目录 Python打印行号Python3打印当前行号,代码如下: import sys print(str(sys._getframe().f_lineno) + " hehe.")Please enable JavaScript to view the comments powered by Giscus.