Hello, I am new to Python and have a mission impossible to a beginner, I need to import a specific table from a source code written in LaTex. I tried to start this code in this way :

import asciitable
from sys import argv


def searching_table(table_identifier):
    with open(fname, "r") as fin:
        mylist = []
        for line in fin:
            line = line.rstrip()
            if table_identifier in line:
                if "begin{tabular}" in line
                    mylist.append(line)
                    if "\end{tabular}" in line

Is there any way simpler than that to do this job?

Re: Finfing a table in LaTex source code file and importing to a string 80 80

Looks like the module you are importing should deal with LaTex http://cxc.cfa.harvard.edu/contrib/asciitable/#reading-tables

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.