Posted to tcl by egavilan at Tue Apr 15 14:24:52 GMT 2008view raw

  1. #!/usr/bin/wish
  2. set pipe2 [open "|./python_pipe_frm_TK.py" r+]
  3. fconfigure $pipe2 -buffering line
  4. puts $pipe2 "Hello world"
  5. set line [gets $pipe2 ]
  6. set lb2 [label .deptLabel2 -text $line]
  7. pack $lb2 -side left
  8.  
  9.  
  10.  
  11. #!/usr/bin/python
  12. import os
  13. import sys
  14. text = fin.readline().strip()
  15. print text
  16. sys.stdout.flush()