Py学习  »  pycharm

pycharm-将代码导出到HTML时的行号

tmn103 • 4 年前 • 475 次点击  

我正在尝试将我的python代码(在pycharm中)用行号导出到HTML。使用“file>export to html”并选择选项:“show line numbers”。

提供了行号,但仅针对注释行,而不是代码。如下所示

我肯定我遗漏了一些简单的东西,但找不到什么?

    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")
Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/38343
 
475 次点击