[Tutor] Tkinter help

paul clanoftheinsane@hotmail.com
Fri, 24 Aug 2001 16:30:36 -0400


This is a multi-part message in MIME format.

------=_NextPart_000_0008_01C12CBA.1AD09120
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

ok, can somebody give me an example of how to assign sys.stdout to a =
file and then print it into a text box?  i think i'm missing something.






  ----- Original Message -----=20
  From: alan.gauld@bt.com=20
  To: clanoftheinsane@hotmail.com ; tutor@python.org=20
  Sent: Friday, August 24, 2001 4:45 AM
  Subject: RE: [Tutor] Tkinter help


    When using Tkinter, i want to have a window within my GUI program =
that will show the output that you normally see in the python =
interpreter window.  for example, i want to have a button display a list =
of data, but instead of that data being displayed in the interpreter, i =
want it to appear in my actual program in a widget.  any ideas?=20
  Its an idea, no more...
  =20
  reassign sys.stdout to a file.
  After every print call a function that copies that file to a=20
  text widget.

  it might work...
  =20
  There is an example of this in Graysons book I think, but I=20
  dont have access to it just now.=20
  =20
  Alan G

------=_NextPart_000_0008_01C12CBA.1AD09120
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>ok, can somebody give me an example of =
how to=20
assign sys.stdout to a file and then print it into a text box?&nbsp; i =
think i'm=20
missing something.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: =
0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A href=3D"mailto:alan.gauld@bt.com"=20
  title=3Dalan.gauld@bt.com>alan.gauld@bt.com</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A=20
  href=3D"mailto:clanoftheinsane@hotmail.com"=20
  title=3Dclanoftheinsane@hotmail.com>clanoftheinsane@hotmail.com</A> ; =
<A=20
  href=3D"mailto:tutor@python.org" =
title=3Dtutor@python.org>tutor@python.org</A>=20
  </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Friday, August 24, 2001 =
4:45=20
  AM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> RE: [Tutor] Tkinter =
help</DIV>
  <DIV><BR></DIV>
  <BLOCKQUOTE=20
  style=3D"BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; =
MARGIN-RIGHT: 0px; PADDING-LEFT: 5px">
    <DIV><FONT size=3D2><FONT face=3DArial>When using Tkinter, i want to =
have a=20
    window within my GUI program that will show the output that you =
normally see=20
    in the python interpreter window.&nbsp; for example, i want to have =
a button=20
    display a list of data, but instead of that data being displayed in =
the=20
    interpreter, i want it to appear in my actual program in a =
widget.&nbsp; any=20
    ideas?<FONT color=3D#0000ff face=3D"Courier New"><SPAN=20
    =
class=3D640474508-24082001>&nbsp;</SPAN></FONT></FONT></FONT></DIV></BLOC=
KQUOTE>
  <DIV><FONT size=3D2><FONT face=3DArial><FONT color=3D#0000ff=20
  face=3D"Courier New"><SPAN class=3D640474508-24082001>Its an idea, no=20
  more...</SPAN></FONT></FONT></FONT></DIV>
  <DIV><FONT size=3D2><FONT face=3DArial><FONT color=3D#0000ff=20
  face=3D"Courier New"><SPAN=20
  class=3D640474508-24082001></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
  <DIV><FONT size=3D2><FONT face=3DArial><FONT color=3D#0000ff=20
  face=3D"Courier New"><SPAN class=3D640474508-24082001>reassign =
sys.stdout to a=20
  file.</SPAN></FONT></FONT></FONT></DIV>
  <DIV><FONT size=3D2><FONT face=3DArial><FONT color=3D#0000ff=20
  face=3D"Courier New"><SPAN class=3D640474508-24082001>After every =
print call a=20
  function that copies that file to a </SPAN></FONT></FONT></FONT></DIV>
  <DIV><FONT size=3D2><FONT face=3DArial><FONT color=3D#0000ff=20
  face=3D"Courier New"><SPAN class=3D640474508-24082001>text=20
  widget.</SPAN></FONT></FONT></FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT size=3D2><FONT face=3DArial><FONT color=3D#0000ff=20
  face=3D"Courier New"><SPAN class=3D640474508-24082001>it might=20
  work...</SPAN></FONT></FONT></FONT></DIV>
  <DIV><FONT size=3D2><FONT face=3DArial><FONT color=3D#0000ff=20
  face=3D"Courier New"><SPAN=20
  class=3D640474508-24082001></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
  <DIV><FONT size=3D2><FONT face=3DArial><FONT color=3D#0000ff=20
  face=3D"Courier New"><SPAN class=3D640474508-24082001>There is an =
example of this=20
  in Graysons book I think, but I </SPAN></FONT></FONT></FONT></DIV>
  <DIV><FONT size=3D2><FONT face=3DArial><FONT color=3D#0000ff=20
  face=3D"Courier New"><SPAN class=3D640474508-24082001>dont have access =
to it just=20
  now.&nbsp;</SPAN></FONT></FONT></FONT></DIV>
  <DIV><FONT size=3D2><FONT face=3DArial><FONT color=3D#0000ff=20
  face=3D"Courier New"><SPAN=20
  class=3D640474508-24082001></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
  <DIV><FONT size=3D2><FONT face=3DArial><FONT color=3D#0000ff=20
  face=3D"Courier New"><SPAN class=3D640474508-24082001>Alan=20
  G</SPAN></FONT></FONT></FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0008_01C12CBA.1AD09120--