PyCharm-将代码导出到html时的行号
我正在尝试将我的python代码(在PyCharm中)导出为带有行号的html。使用“文件>导出到Html”并选择选项:“显示行号” 提供了行号,但仅针对注释行,而不是代码。如下 我肯定我错过了一些简单的东西,但找不到什么PyCharm-将代码导出到html时的行号,pycharm,Pycharm,我正在尝试将我的python代码(在PyCharm中)导出为带有行号的html。使用“文件>导出到Html”并选择选项:“显示行号” 提供了行号,但仅针对注释行,而不是代码。如下 我肯定我错过了一些简单的东西,但找不到什么 1 import pandas as pd import csv import os current_file_path = __file__ current_file_dir = os.path.dirname(__file__) def test (i
1 import pandas as pd
import csv
import os
current_file_path = __file__
current_file_dir = os.path.dirname(__file__)
def test (input_text):
"""
2 This is a
3 test
4 """
#do something
print(input_text)
print("there are no line numbers here")
我试图导出为html的代码如下所示:
import pandas as pd
import csv
import os
current_file_path = __file__
current_file_dir = os.path.dirname(__file__)
def test (input_text):
"""
This is a
test
"""
#do something
print(input_text)
print("there are no line numbers here")
您能显示您试图导出为html的代码段吗?添加到问题我复制了您发布并导出为html的代码。就我而言,行号是可以的。