Tkinter question - proper output in Text widget

T. Kaufmann merman at snafu.de
Wed Jul 9 10:01:20 EDT 2003


Hi there,

I have some lines of code in a Tkinter programm - I want to list every single 
file of a zip-archive in a Text widget:

fp = os.popen("%s %s" % ('unzip -vl ', 'anyarchiv.zip', 'r')
for line in fp:
     textWidget.insert(END, "%s" % (line))

The result is that the columns are not really proper if the file-size of the 
listed files is different. An output example:


  Length   Method    Size  Ratio   Date   Time   CRC-32    Name
--------  ------  ------- -----   ----   ----   ------    ----
     1175  Defl:N      513  56%  05-23-03 13:51  084e4103  charset.py
      972  Defl:N      427  56%  04-05-03 18:42  b8bb850d  controller.py


Here it looks good but not in my application (in the Text widget). Whats wrong?
How can I made a better result (proper columns).

o-o

Thomas





More information about the Python-list mailing list