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


Groups > comp.lang.python > #42618

Re: Tkinter

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.mixmin.net!eweka.nl!hq-usenetpeers.eweka.nl!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <renato.barbosa.pim.pereira@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'insert': 0.05; 'context': 0.07; 'responding': 0.07; 'tkinter': 0.07; '%s"': 0.09; 'cc:addr :python-list': 0.11; 'python': 0.11; 'def': 0.12; 'project,': 0.12; 'assume': 0.14; 'cc:name:python list': 0.16; 'elementos': 0.16; 'luck,': 0.16; 'luckily,': 0.16; 'namespace.': 0.16; 'numero': 0.16; 'numpy': 0.16; 'quantum': 0.16; 'renamed': 0.16; 'responses.': 0.16; 'screen,': 0.16; 'scrollbar': 0.16; 'subject:Tkinter': 0.16; 'tk()': 0.16; 'wrote:': 0.18; 'do.': 0.18; 'variable': 0.18; 'module': 0.19; 'trying': 0.19; 'input': 0.22; 'import': 0.22; 'email addr:gmail.com&gt;': 0.22; 'cc:addr:python.org': 0.22; 'entries': 0.24; 'finally,': 0.24; 'ph.d.': 0.24; 'cc:2**0': 0.24; 'task': 0.26; 'this:': 0.26; 'pass': 0.26; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'leave': 0.29; 'am,': 0.29; 'label': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'gives': 0.31; 'this.': 0.32; 'skip:c 30': 0.32; 'skip:m 30': 0.32; 'guess': 0.33; 'lab': 0.33; 'skip:t 40': 0.33; 'candidate': 0.34; 'created': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'version': 0.36; '(e.g.,': 0.36; 'replies': 0.36; 'thanks': 0.36; 'should': 0.36; 'list': 0.37; 'skip:& 10': 0.38; 'bringing': 0.38; 'jason': 0.38; 'window': 0.38; 'does': 0.39; 'sure': 0.39; 'university': 0.39; 'called': 0.40; 'skip:\xc2 10': 0.60; 'tell': 0.60; 'skip:t 30': 0.61; 'skip:n 10': 0.64; 'to:addr:gmail.com': 0.65; 'media': 0.66; '8bit%:100': 0.72; 'click': 0.77; 'florida': 0.78; 'responses': 0.93; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=Z9DUMcivL2lGzz8CP4BhVmK0XkkXvyyPOfS6uishAM4=; b=0juuLIE1dL9IJxfN3ZkKR0Y6mPKqaBfNDPTkWjEVFEQSyHUYjc6pSVIdp1gqp3ITam 8+2ABvA97DpQOhiX9j/gfTbqWjq+z2OeJO2xRT+488nIVZJkSPuR4kXN0rZRabPzvy10 z28H//7K0PmB3rEpgQsdKge6uCTqWIWA72lOBQ/D0djnrIAy5RMVymk35nwxxzWuk/wI 45TxzwxH33Q9HNUCm1gQLf4BJjMfvPIGC9GyP872jJTKXxjxhgU6x/NVTm1VU4J6O88A 55XnY6eivYv6pqX40hGjTQKGWRJ+2Is3V1B46rZNUTvPUH13js6xo01LqaHwrcmeb6fH R2vQ==
MIME-Version 1.0
X-Received by 10.180.108.106 with SMTP id hj10mr6701250wib.0.1364954665702; Tue, 02 Apr 2013 19:04:25 -0700 (PDT)
In-Reply-To <CAEk9e3p097wC0dHagQe_=9CTYkYVyH-TMmLZ-Lf7=WRMUf5_DQ@mail.gmail.com>
References <CAHq3d9C_ruMdbhc2vWZJCRDh=o4yQhEm33r=CMp9rbzqGYdx6g@mail.gmail.com> <CAEk9e3o=CzSeHD902DmMiVgXY0ZK1S4wLnDY0DOQw1Ab03QKXA@mail.gmail.com> <CAHq3d9Cfudq1RpvAnuGEjr4PWjuqqaskqerDHa_OLSYnJhb6dw@mail.gmail.com> <CAEk9e3p097wC0dHagQe_=9CTYkYVyH-TMmLZ-Lf7=WRMUf5_DQ@mail.gmail.com>
Date Tue, 2 Apr 2013 23:04:25 -0300
Subject Re: Tkinter
From Renato Barbosa Pim Pereira <renato.barbosa.pim.pereira@gmail.com>
To Jason Swails <jason.swails@gmail.com>
Content-Type multipart/alternative; boundary=e89a8f3bb03dfbdb0304d96b45e7
Cc python list <python-list@python.org>
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.31.1364954667.3114.python-list@python.org> (permalink)
Lines 220
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1364954667 news.xs4all.nl 6873 [2001:888:2000:d::a6]:47076
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:42618

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Thanks for the advices, I need now one scrollbar to roll under screen, I
created the scrollbar but cant roll, please help me on this.

http://pastebin.com/L6XWY6cm


2013/4/2 Jason Swails <jason.swails@gmail.com>

> Please keep response replies to the Python list (e.g., use 'reply all' or
> just send the email to python-list).
>
> Also, you should tell people what Python version you are using. I assume
> you are using Python 2 since Tkinter was renamed to tkinter in Python 3.
>
> Finally, do not top-post.  Type your responses inside the body of the
> email you are responding to.  That gives people context for your responses.
>
> On Tue, Apr 2, 2013 at 11:48 AM, Renato Barbosa Pim Pereira <
> renato.barbosa.pim.pereira@gmail.com> wrote:
>
>> Sorry for my inconsistence:
>>
>> I need a textbox to get one number and pass for variable called numero
>> with one click of button. Thanks .
>>
>> I have this:
>>
>> import numpy as np
>> import matplotlib.pyplot as plt
>> from Tkinter import *
>> import tkMessageBox
>>
>> prefixo = "vetor"
>> numero = 10
>> numeroVetores = 0
>>
>> def makeWidgets(numero):
>>     global entries
>>     window = Tk()
>>     window.title('Vetores')
>>     form = Frame(window)
>>     form.pack()
>>     entries = {}
>>     for ix in range(numero):
>>         label = "%s %s" % (prefixo , ix + 1)
>>         lab = Label(form, text=label)
>>         ent = Entry(form)
>>         lab.grid(row=ix, column=0)
>>         ent.grid(row=ix, column=1)
>>         entries[label] = ent
>>
>>
>>
>>
>>
>>     Button(window, text="Calcular",  command=calcular).pack(side=LEFT)
>>     Button(window, text="Media",  command=media).pack(side=LEFT)
>>
>>
>>
>>     return window
>>
>>
>>
>> def pegavalores():
>>     valores = []
>>     for chave, entrada in sorted(entries.items()):
>>         valores.append(entrada.get())
>>
>>     return valores
>>
>>
>> def calcular():
>>     calcular = pegavalores()
>>     plt.plot(calcular)
>>     plt.show()
>>
>> def media():
>>     media = pegavalores()
>>     elementos = len(media)
>>     media = np.asarray(media, dtype=np.float64)
>>     valormedio = np.sum(media)/elementos
>>     tkMessageBox.showinfo("Media", valormedio)
>>
>>
>> window = makeWidgets(numero)
>> window.mainloop()
>>
>
> I'm not sure exactly what you are trying to do.  My guess is that you want
> to get "numero" from user input.  Luckily, the tkSimpleDialog module
> contains a handy function that does just this: askinteger.  So add a call:
>
> numero = tkSimpleDialog.askinteger('Window Title', 'Please insert the
> number of input values you want')
> window = makeWidgets(numero)
> window.mainloop()
>
> I leave to you the task of bringing tkSimpleDialog into your namespace.
>
> Good luck,
> Jason
> --
> Jason M. Swails
> Quantum Theory Project,
> University of Florida
> Ph.D. Candidate
> 352-392-4032
>

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


Thread

Re: Tkinter Renato Barbosa Pim Pereira <renato.barbosa.pim.pereira@gmail.com> - 2013-04-02 23:04 -0300

csiph-web