

Und dabei hab' ich mir doch jetzt fest vorgenommen, ganz viele englischsprachige Vortragsvideos etc. anzuschauen, damit ich nächstes Jahr auf der Europython in Berlin einigermaßen Land sehe...
Aber das muss ich wohl nochmals überdenken....

mutetella
Code: Alles auswählen
$ dpkg --get-selections 'python3*' | awk '{ print $1 }' | shcol
python3 python3-lxml
python3-apt python3-minimal
python3-aptdaemon python3-oauthlib
python3-aptdaemon.gtk3widgets python3-pkg-resources
python3-aptdaemon.pkcompat python3-pyatspi2
python3-brlapi python3-pycurl
python3-cairo python3-software-properties
python3-crypto python3-speechd
python3-dbus python3-virtkey
python3-defer python3-xkit
python3-gdbm python3.2
python3-gi python3.2-minimal
python3-gi-cairo python3.3
python3-httplib2 python3.3-minimal
python3-louis
Code: Alles auswählen
$ dpkg --get-selections 'python3*' | awk '{ print $1 }' | shcol -w100 -s5
python3 python3-gdbm python3-pycurl
python3-apt python3-gi python3-software-properties
python3-aptdaemon python3-gi-cairo python3-speechd
python3-aptdaemon.gtk3widgets python3-httplib2 python3-virtkey
python3-aptdaemon.pkcompat python3-louis python3-xkit
python3-brlapi python3-lxml python3.2
python3-cairo python3-minimal python3.2-minimal
python3-crypto python3-oauthlib python3.3
python3-dbus python3-pkg-resources python3.3-minimal
python3-defer python3-pyatspi2
Es geht darum, dass `get_terminal_width()` ausgeführt werden soll und ob die angegebene Breite zutrifft. Am besten auch mal während der Sitzung in der Python-Shell das Terminal-Fenster breiter und schmaler machen und gucken, ob sich die Werte anpassen. Und ruhig sowohl über `cmd.exe` als auch über die PowerShell.fail hat geschrieben:Läuft ohne Fehlermeldungen, aber gibt nichts aus.??
Edit: Windows 8.1 64-bit
Code: Alles auswählen
import sys
import _termwidth
_termwidth.get_terminal_width(sys.stdout, 80)
Code: Alles auswählen
import test
import sys
test.get_terminal_width(sys.stdout, 80)
Code: Alles auswählen
Traceback (most recent call last):
File "C:\Users\fail\Desktop\test2.py", line 4, in <module>
test.get_terminal_width(sys.stdout, 80)
File "C:\Users\fail\Desktop\test.py", line 34, in get_terminal_width
num_handle = -(10 + tty_file.fileno())
io.UnsupportedOperation: fileno
Code: Alles auswählen
Traceback (most recent call last):
File "test2.py", line 4, in <module>
test.get_terminal_width(sys.stdout, 80)
File "C:\Users\fail\Desktop\test.py", line 35, in get_terminal_width
handle = GetStdHandle(num_handle)
TypeError: this function takes 2 arguments (1 given)
Code: Alles auswählen
Traceback (most recent call last):
File "test2.py", line 4, in <module>
test.get_terminal_width(sys.stdout, 80)
File "C:\Users\fail\Desktop\test.py", line 35, in get_terminal_width
handle = GetStdHandle(num_handle)
TypeError: this function takes 2 arguments (1 given)
Code: Alles auswählen
Traceback (most recent call last):
File "C:\Users\fail\Desktop\termwidth.py", line 71, in <module>
print(test())
File "C:\Users\fail\Desktop\termwidth.py", line 68, in test
fd = sys.__stdout__.fileno()
AttributeError: 'NoneType' object has no attribute 'fileno'
Bitte schoensnafu hat geschrieben:Achso, und könnte jemand von den Mods den Thread ins Showcase-Forum verschieben? Danke.
Code: Alles auswählen
usage: shcol [-h] [-s N] [-w N] [-S] [-U] [-c N] [-v] [item [item ...]]
Generate columnized output for given string items.
Columize and sort:
shcol -S foo bar baz
Columnize command output on Linux (Debian):
shcol -S -c0 < /proc/modules
dpkg --get-selections 'python3*' | shcol -c0 -s4
Columnize process names on Windows PowerShell:
ps | foreach {$_.name} | shcol -U
positional arguments:
item an item to columnize
(read from stdin if item arguments are not present)
optional arguments:
-h, --help show this help message and exit
-s N, --spacing N number of blanks between two columns (default: 2)
-w N, --width N maximal amount of characters per line
(use terminal width by default)
-S, --sort sort the items
-U, --unique process only the first occurrence of an item
(i.e. doublets are eliminated)
-c N, --column N choose a specific column per line via an index value
(indices start at 0, column separator is whitespace)
will only work when items are supplied via stdin
-v, --version show program's version number and exit