Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "A. ElKader" Newsgroups: comp.lang.python Subject: Help is needed! Date: Fri, 1 Apr 2016 10:34:20 +0300 Lines: 55 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de 27KOP5L/tcerzoI5sX7xgAFpiGLvXL1xsrSGjNLq16Rg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '"""': 0.05; 'arg': 0.09; 'buttons': 0.09; 'callback': 0.09; 'cmd': 0.09; 'subject:Help': 0.10; 'output': 0.13; 'def': 0.13; 'skip:f 30': 0.15; 'bind': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'skip:/ 50': 0.16; 'skip:n 90': 0.16; 'subprocess': 0.16; 'gui': 0.18; 'shell': 0.18; 'skip:= 10': 0.18; 'changes': 0.20; 'tkinter': 0.22; 'trying': 0.22; 'import': 0.24; 'script': 0.25; 'command': 0.26; 'message-id:@mail.gmail.com': 0.27; 'skip:/ 40': 0.29; 'skip:b 40': 0.29; 'print': 0.30; 'code': 0.30; 'skip:s 30': 0.31; 'advice': 0.35; 'skip:& 20': 0.35; 'received:google.com': 0.35; 'text': 0.35; '???': 0.35; 'integrate': 0.35; 'but': 0.36; 'needed': 0.36; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'skip:& 10': 0.37; 'received:209': 0.38; 'button': 0.38; 'hi,': 0.38; 'to:addr:python.org': 0.40; 'called': 0.40; 'show': 0.62; 'real': 0.62; 'url:png': 0.64; 'sans': 0.72; 'click': 0.76; 'url:i': 0.77; 'url:imgur': 0.84; 'vera': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to; bh=BcGWaNp2zo5Y/qQr/3d1bQL0eNvNBgBzJiHPmO7n9AY=; b=WKV2Bv6aDEBzo7wP0tBRI3ceDLIph3VkxidbXU4MGukul7Ygr1nWeqVYSlCIBViYtV RVvm4kmv13nLEjh2wR6xxuwmZWiWv8XD49wx7JWsvAbXWR8NQ6kjYEpMFXKamp4MNwIa ARk37KT6Sc/ROBskWrHyX5ZcdFTiTmCe3XXIC7mx+QTUpb7KWvxQgenjLwlIxWMTXQCP Q1Oi0xRxL94+BGNYu9EY1AkZwR1BNm/cMUhnDxm8h2MjSjAJd/rXVxdhHSSelfLvC1qY IvPZRoS80DTr2wRrKWNuK4vidMgzrqJUmZlYsUBuWLDtngqoxz819wWlVeWMn48M/ayX 6Ktg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=BcGWaNp2zo5Y/qQr/3d1bQL0eNvNBgBzJiHPmO7n9AY=; b=FuQwpVD6tb0fDHAysfymeEUb5nhZYwEekBv930WKZy5C/Y20HvVz4Nvzmzhja66kw6 xeeGROCq6aUjXkUgbKgevxwVQCHztCz8duMrYQgYSgKJbPlYYthHf7cvNz7tSUFCQ3mk zyscDHA6bMQfpagyzVKQcOu/I4iyGvsBcqQ20fcg1SE8FImzAwuvVwsZ7bNV8XKy3+hp VsKPhI6UlvCvTNAvysCp95PCsDdGCmhpxje5F+F1dl5CKV4nL2V9Hq3cfLqbhcW/ZvEh mTPqf2lzcT99VMg1Egfol2RbQOmlss5Xj02j1rJIvdMeFzlH+7Mr+IGLYn6sxNgLbbNa pRrg== X-Gm-Message-State: AD7BkJL75xto/1mcH5JAc5Fa1tGAIKDAjFUaYGb2B5dvgvC9dLvxrubGK4i+YIY2LmZSWRcIMO/A1rbFxGYTJA== X-Received: by 10.112.188.134 with SMTP id ga6mr1877752lbc.77.1459496060725; Fri, 01 Apr 2016 00:34:20 -0700 (PDT) X-Mailman-Approved-At: Fri, 01 Apr 2016 03:36:18 -0400 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:106206 Hi, I am trying to do the following : I am trying to show the changes in the command line in real time in my Tkinter GUI, I managed to create the GUI and integrate the terminal into it, but I cant bind the buttons with the terminal, my code is : import Tkinterfrom Tkinter import *import subprocessimport osfrom os import system as cmd WINDOW_SIZE = "600x400" top = Tkinter.Tk() top.geometry(WINDOW_SIZE) def helloCallBack(): print "Below is the output from the shell script in terminal" subprocess.call('perl /projects/tfs/users/$USER/scripts_coverage.pl', shell=True)def BasicCovTests(): print "Below is the output from the shell script in terminal" subprocess.call('perl /projects/tfs/users/$USER/basic_coverage_tests.pl', shell=True)def FullCovTests(): print "Below is the output from the shell script in terminal" subprocess.call('perl /projects/tfs/users/$USER/basic_coverage_tests.pl', shell=True) Scripts_coverage = Tkinter.Button(top, text ="Scripts Coverage", command = helloCallBack)Scripts_coverage.pack() Basic_coverage_tests = Tkinter.Button(top, text ="Basic Coverage Tests", command = BasicCovTests)Basic_coverage_tests.pack() Full_coverage_tests = Tkinter.Button(top, text ="Full Coverage Tests", command = FullCovTests)Full_coverage_tests.pack() termf = Frame(top, height=100, width=500) termf.pack(fill=BOTH, expand=YES) wid = termf.winfo_id() os.system('xterm -into %d -geometry 100x20 -sb &' % wid) def send_entry_to_terminal(*args): """*args needed since callback may be called from no arg (button) or one arg (entry) """ cmd("%s" % (BasicCovTests)) top.mainloop() I want win I click the button to see it printing the command in the terminal[image: enter image description here] How do I do that ??? Please advice