M
M
MrFlatman2018-02-19 22:59:45
Python
MrFlatman, 2018-02-19 22:59:45

Prevent wrapping in Python when outputting a response?

Version of Python 2.7.14, it is necessary to display the table, but it does not fit on a line and it turns out that it transfers half of the table to a new line, how can this be avoided?
PS yes, like what to put after print, I tried it, it didn't help :)

def main():
    """ main """
    parsed_xml = et.parse("book.xml")
    dfcols = ['author', 'name', 'publich', 'year','page']
    df_xml = pd.DataFrame(columns=dfcols)
 
    for node in parsed_xml.getroot():
        author=node.find('author')
        name = node.find('name')
        publich = node.find('publich')
        year = node.find('year')
        page = node.find('page')
 
        df_xml = df_xml.append(
            pd.Series([getvalueofnode(author), getvalueofnode(name), getvalueofnode(publich),
                       getvalueofnode(year),getvalueofnode(page)], index=dfcols),
            ignore_index=True)
 
    print df_xml

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2018-02-19
@dimonchik2013

pytablewriter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question