Skip to content
This repository was archived by the owner on Dec 7, 2021. It is now read-only.

Table show error #57

Open
XuCcc opened this issue Feb 9, 2018 · 2 comments
Open

Table show error #57

XuCcc opened this issue Feb 9, 2018 · 2 comments

Comments

@XuCcc
Copy link

XuCcc commented Feb 9, 2018

My Codes:

from terminaltables import SingleTable
...
    def show(self, nametuple):
        datas = []
        datas.append(("id",) + nametuple._fields[:-1])
        for i, data in enumerate(self.data):
            datas.append((i,) + data[:-1])
        print SingleTable(datas).table
.                                                                                                                                                              [ 19%]
test/test_dataBase.py .s..┌────┬────────────┬─────────┬─────────┐
│ id │ ip         │ web     │ pwn     │
├────┼────────────┼─────────┼─────────┤
│ 0  │ 10.10.10.1 │ 8080 80 │ 9090 90 │
│ 1  │ 10.10.10.2 │ 8080 80 │ 9090 90 │
│ 2  │ 10.10.10.3 │ 8080 80 │ 9090 90 │
│ 3  │ 10.10.10.4 │ 8080 80 │ 9090 90 │
│ 4  │ 10.10.10.5 │ 8080 80 │ 9090 90 │
└────┴────────────┴─────────┴─────────┘

it workds ok,but after i import pwntools

from terminaltables import SingleTable
...
from pwn import *
...
    def show(self, nametuple):
        datas = []
        datas.append(("id",) + nametuple._fields[:-1])
        for i, data in enumerate(self.data):
            datas.append((i,) + data[:-1])
        print SingleTable(datas).table
test/test_dataBase.py .s..lqqqqwqqqqqqqqqqqqwqqqqqqqqqwqqqqqqqqqk
x id x ip         x web     x pwn     x
tqqqqnqqqqqqqqqqqqnqqqqqqqqqnqqqqqqqqqu
x 0  x 10.10.10.1 x 8080 80 x 9090 90 x
x 1  x 10.10.10.2 x 8080 80 x 9090 90 x
x 2  x 10.10.10.3 x 8080 80 x 9090 90 x
x 3  x 10.10.10.4 x 8080 80 x 9090 90 x
x 4  x 10.10.10.5 x 8080 80 x 9090 90 x
mqqqqvqqqqqqqqqqqqvqqqqqqqqqvqqqqqqqqqj
.lqqqqwqqqqqqqqqqqqqwqqqqqqwqqqqqqqqqqwqqqqqqqqqqk
DavidMarchant added a commit to openflighthpc/flight-directory that referenced this issue Aug 28, 2018
- changed click.echo to click.echo_via_pager for a `less` style output
- also changed SingleTable for DoubleTable as single table was
displaying table borders as q's, n's and u's with the pager. This is
similar to what was happening with Wil's and PuTTy and seesms to be
known issue (Robpol86/terminaltables#57)
bobwhitelock pushed a commit to alces-software/adminware that referenced this issue Sep 11, 2018
- changed click.echo to click.echo_via_pager for a `less` style output
- also changed SingleTable for DoubleTable as single table was
displaying table borders as q's, n's and u's with the pager. This is
similar to what was happening with Wil's and PuTTy and seesms to be
known issue (Robpol86/terminaltables#57)
@roganartu
Copy link

I came across this too, but it happened even without any other packages.

#!/usr/bin/env python3.6

from terminaltables import SingleTable, DoubleTable

data = [
    ["Testing", "Header"],
    ["foo", "bar"],
]

print(SingleTable(data).table)
print(DoubleTable(data).table)

outputs:

lqqqqqqqqqwqqqqqqqqk
x Testing x Header x
tqqqqqqqqqnqqqqqqqqu
x foo     x bar    x
mqqqqqqqqqvqqqqqqqqj
╔═════════╦════════╗
║ Testing ║ Header ║
╠═════════╬════════╣
║ foo     ║ bar    ║
╚═════════╩════════╝

Interestingly, if I run it inside tmux it works fine:

┌─────────┬────────┐
│ Testing │ Header │
├─────────┼────────┤
│ foo     │ bar    │
└─────────┴────────┘
╔═════════╦════════╗
║ Testing ║ Header ║
╠═════════╬════════╣
║ foo     ║ bar    ║
╚═════════╩════════╝

I don't like the DoubleTable, but the WindowsTable appears to work fine as an alternative to UnixTable on non-windows machines that I've tested if anyone else stumbles across this via Google like I did.

@rotaugenlaubfrosch
Copy link

Hi All,
Any news regarding this issue? SingleTable seems to print a lot of "q"'s - but using DoubleTable it works fine. This is really strange.
Best regards

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants