Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #44278

Re: My gui

Path csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <davea@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.073
X-Spam-Evidence '*H*': 0.85; '*S*': 0.00; 'tkinter': 0.07; 'bash': 0.09; 'width': 0.09; 'def': 0.12; 'gui': 0.12; "wouldn't": 0.14; 'received:74.208.4.195': 0.16; 'subject:gui': 0.16; 'wrote:': 0.18; 'command': 0.22; 'import': 0.22; 'header:User-Agent:1': 0.23; 'copied': 0.24; 'daniel': 0.26; 'header:In-Reply-To:1': 0.27; "i'm": 0.30; 'code': 0.31; 'helpful.': 0.31; 'class': 0.32; 'run': 0.32; 'text': 0.33; 'skip:_ 10': 0.34; "i'd": 0.34; 'equal': 0.35; 'but': 0.35; 'idle': 0.36; 'being': 0.38; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'skip:t 30': 0.61; 'today,': 0.61; 'forward': 0.65; 'distance': 0.65; 'here': 0.66; 'sample': 0.67; 'received:74.208': 0.68; 'home': 0.69; 'user,': 0.69; 'day': 0.76; 'textbook': 0.84
Date Wed, 24 Apr 2013 13:46:22 -0400
From Dave Angel <davea@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5
MIME-Version 1.0
To python-list@python.org
Subject Re: My gui
References <09b96d6b-6db3-42a2-88d3-5fe16984fed1@googlegroups.com>
In-Reply-To <09b96d6b-6db3-42a2-88d3-5fe16984fed1@googlegroups.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:0Gnxk4kAbKzI/tcaZqFtkrloHWEflUszChT6ChvbEWs se1HNqxD7DASJ4ITkq6T7YV385An2RyGe7GMZdwHnovLIcBWo/ 8+/qd0IOh2lMlPvBFK8yUMIgq/sQEFlSsxe0j8a79BZ5Apx/YW 91D+uTjptEfMjCRwOVObFAJ3r540bSWLqVLYZo7cbkRyR2uu1Q vCuWZPm3Tryy3DxQU3xjj3PRvC1voxzYCcUkkG6sh1UntMWExu GmX4zouK9nthSQn6DHAGFsIfTvB8HSbWx3YPpy3J6Smo4DR9r1 WczMzGp+QK8Jw9oDLke+KvPZXCvvZZ3JJ9VfzZ9jaCwaFdrUg= =
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1025.1366825599.3114.python-list@python.org> (permalink)
Lines 48
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1366825599 news.xs4all.nl 15981 [2001:888:2000:d::a6]:40729
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:44278

Show key headers only | View raw


On 04/24/2013 01:08 PM, Daniel Kersgaard wrote:
> Today, being the last day of lectures at school, my instructor ran briefly through Tkninter and GUIs. I'd been looking forward to this particular lesson all semester, but when I got home and copied a sample program from my textbook verbatim, IDLE does nothing. No error, no nothing. Any ideas? Here  is the code from my program. I'm not sure if this is appropriate, but suggestions are helpful.
>
> import tkinter
> import tkinter.messagebox
>
> class MyGui:
>      def _init_(self):
>          self.main_window = tkinter.Tk()
>
>          self.top_frame = tkinter.Frame(self.main_window)
>          self.bottom_frame = tkinter.Frame(self.main_window)
>
>          self.prompt_label = tkinter.Label(self.top_frame, text = 'Enter a distance in Kilometers: ')
>          self.kilo_entry = tkinter.Entry(self.top_frame, width = 10)
>
>          self.prompt_label.pack(side = 'left')
>          self.kilo_entry.pack(side = 'left')
>
>          self.calc_button = tkinter.Button(self.bottom_frame, text = 'Convert', command = self.convert)
>
>          self.quit_button = tkinter.Button(self.bottom_frame, text = 'Quit', command = self.main_window.destroy)
>
>          self.calc_button.pack(side = 'left')
>          self.quit_button.pack(side = 'left')
>
>          self.top_frame.pack()
>          self.bottom_frame.pack()
>
>          tkinter.mainloop()
>
>      def convert(self):
>          kilo = float(self.kilo_entry.get())
>
>          miles = kilo * 0.6214
>
>          tkinter.messagebox.showinfo('Result', str(kilo) + ' kilometers is equal to ' + str(miles) + 'miles.')
>
> poop = MyGui()
>

I'm not an IDLE user, but I wouldn't be surprised if IDLE interferes 
with some GUI apps.   I'd run your code from the bash prompt.



-- 
DaveA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

My gui Daniel Kersgaard <danielkersgaard@gmail.com> - 2013-04-24 10:08 -0700
  Re: My gui Dave Angel <davea@davea.name> - 2013-04-24 13:46 -0400
  Re: My gui Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2013-04-24 19:53 +0200
  Re: My gui Ned Batchelder <ned@nedbatchelder.com> - 2013-04-24 14:08 -0400
  Re: My gui Arnaud Delobelle <arnodel@gmail.com> - 2013-04-24 20:42 +0100
    Re: My gui Neil Cerutti <neilc@norwich.edu> - 2013-04-24 20:26 +0000
  Re: My gui Terry Jan Reedy <tjreedy@udel.edu> - 2013-04-24 22:51 -0400
  Re: My gui Chris Angelico <rosuav@gmail.com> - 2013-04-25 13:17 +1000

csiph-web