Re: Tkinter -- the best way to make a realtime loop

2009-10-08 Thread eb303
On Oct 8, 12:40 am, J Wolfe wrote: > What's the best way to make a realtime loop in Tkinter? I know in > perl you can use "repeat" and it will call a function every x seconds, > in python it seems like "after" may be the equivalent though it > doesn't seem to behave like the perl repeat function.

Re: Tkinter -- the best way to make a realtime loop

2009-10-09 Thread eb303
On Oct 8, 7:15 pm, J Wolfe wrote: > Thank you both for your replies. I had something similar to this: > > def incr(): > var.set(1 + var.get()) > root.after(1000, incr) > > except I had an extra set of parenthesis... > def incr(): > var.set(1 + var.get()) > root.after(1000, incr()) > > on

Re: Python GUI

2009-10-26 Thread eb303
On Oct 26, 3:53 am, Grant Edwards wrote: > On 2009-10-26, Philip Semanchuk wrote: > > > > > On Oct 25, 2009, at 8:39 PM, Ronn Ross wrote: > > >> I need to create a gui for python. I'm looking for something that is > >> easy to > >> learn and cross platform. Any suggestions? If you have any good >

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-28 Thread eb303
On Oct 28, 7:52 am, "Alf P. Steinbach" wrote: [snip] > But since I don't know much Python -- I'm *learning* Python as I write -- I > know > that there's a significant chance of communicating misconceptions, > non-idiomatic > ways to do things, bad conventions, etc., in addition to of course plai

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-28 Thread eb303
On Oct 28, 10:48 am, "Alf P. Steinbach" wrote: > * eb303: > > > On Oct 28, 7:52 am, "Alf P. Steinbach" wrote: > > [snip] > >> But since I don't know much Python -- I'm *learning* Python as I write -- > >> I know > >> t

Re: "Hello, world"?

2009-10-28 Thread eb303
On Oct 28, 11:23 am, Francesco Bochicchio wrote: > On 28 Ott, 10:40, Gilles Ganault wrote: > > > Hello > > > I'm reading O'Reily's "Python Programming on Win32", but couldn't find > > a simple example on how to create a window with just a label and > > pushbutton. > > This is probably because may

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-28 Thread eb303
On Oct 28, 11:57 am, "Alf P. Steinbach" wrote: > * eb303: > > > > > On Oct 28, 10:48 am, "Alf P. Steinbach" wrote: > >> * eb303: > > >>> On Oct 28, 7:52 am, "Alf P. Steinbach" wrote: > >>> [snip] > >&g

PyGDChart2 module

2009-10-28 Thread eb303
Hi all, I was looking for a simple chart drawing Python module and as a user of the gd library and its Python interface, I was interested in the Python interface to the gdchart library (http://www.fred.net/brv/ chart/). Unfortunately, this module seems to have disappeared: its former URL (http://w

Re: Tkinter callback arguments

2009-11-02 Thread eb303
On Nov 1, 8:53 pm, Lord Eldritch wrote: > Hi > > Maybe this is maybe something it has been answered somewhere but I haven't > been able to make it work. I wanna pass one variable to a callback function > and I've read the proper way is: > > Button(.., command=lambda: function(x)) > > So with >

Re: PyGDChart2 module

2009-11-03 Thread eb303
On Oct 28, 4:52 pm, eb303 wrote: > Hi all, > > I was looking for a simple chart drawing Python module and as a user > of the gd library and its Python interface, I was interested in the > Python interface to the gdchart library (http://www.fred.net/brv/ > chart/). Unfortunately,

Re: Instance factory - am I doing this right?

2010-03-04 Thread eb303
On Mar 3, 6:41 pm, Laszlo Nagy wrote: > This is just an interesting code pattern that I have recently used: > > class CacheStorage(object): >     """Generic cache storage class.""" >     @classmethod >     def get_factory(cls,*args,**kwargs): >         """Create factory for a given set of cache st

Re: default value in list comprehension

2010-04-19 Thread eb303
On Apr 19, 2:20 pm, AlienBaby wrote: > Hi, > > just a quick one, > > Is it possible to achieve a default value in a list comprehension > where the if-clause is false? > > Ie, something similar to: > > [ a for a in b if something(a) else 'default' ] > > the idea being that, rather than skip a value

Re: Tkinter scrollbar background color doesn't work

2010-04-20 Thread eb303
On Apr 19, 6:35 pm, KL wrote: > Tkinter scrollbar widget's "background" and "relief" options seem not > work. > > The below is the codes I tried and the python/tk information: > === > > ActivePython 2.6.4.8 (ActiveState Software Inc.) based on > Python 2.6.4 (r264:75706, Nov  3 200

Re: Tkinter question

2010-04-21 Thread eb303
On Apr 21, 12:45 pm, Rotwang wrote: > Apologies in advance if this is a totally stupid question, I've tried > looking at the Tkinter documentation on the web but since I'm something > of an ignoramus when it comes to programming generally I didn't > understand what I was reading. Anyway... > > I'v

Re: Tkinter question

2010-04-23 Thread eb303
On Apr 22, 5:55 pm, Rotwang wrote: > James Mills wrote: > > On Wed, Apr 21, 2010 at 8:45 PM, Rotwang wrote: > > >> [...] > > >>From reading the documentation myself (pydoc)... > > > It would seem your only option is to make a thread > > out of this (not my preferred way - I was hoping it was > >

Re: Tkinter question

2010-04-23 Thread eb303
On Apr 23, 1:58 pm, Rotwang wrote: > eb303 wrote: > > On Apr 22, 5:55 pm, Rotwang wrote: > > >> [...] > > > From my experience, mixing Tkinter with threads is a bad idea. As most > > GUI toolkits, it really doesn't like to be manipulated from different

Re: py3 tkinter Text accepts what bytes?

2010-04-23 Thread eb303
On Apr 23, 2:00 pm, Matthias Kievernagel wrote: > Hello, > > I stumbled upon this one while porting some of my programs > to Python 3.1. The program receives messages from a socket > and displays them in a tkinter Text. Works fine in Python 2 > and Python 3.1. The problems arrived when I wanted to

Re: platform-independent image copy/paste with Tkinter?

2010-05-17 Thread eb303
On May 15, 4:56 pm, technocake wrote: > Hi. > > Is there a good way to copy from or paste to the clipboard on all > systems running python using Tkinter? > started a small road too it here: > > #!/usr/bin/python > __author__="technocake" > __date__ ="$15.mai.2010 15:53:39$" > > from Tkinter import

Minor annoyances with properties

2010-05-27 Thread eb303
Hello all, I've been using Python properties quite a lot lately and I've found a few things that are a bit annoying about them in some cases. I wondered if I missed something or if anybody else has this kind of problems too, and if there are better solutions than the ones I'm using ATM. The first

Re: Minor annoyances with properties

2010-05-28 Thread eb303
On May 27, 3:24 pm, Christian Heimes wrote: > >  Do I miss something? > > Is this the way to do it, or is there a better one? > > A better way was introduced in Python 2.6. > Seehttp://docs.python.org/library/functions.html?highlight=property#prop... > I have a Python only version around if you a

Re: Minor annoyances with properties

2010-05-28 Thread eb303
On May 27, 8:56 pm, Francesco Bochicchio wrote: > On 27 Mag, 14:37, eb303 wrote: > > > > > Hello all, > > > I've been using Python properties quite a lot lately and I've found a > > few things that are a bit annoying about them in some cases. I >

Re: Minor annoyances with properties

2010-05-28 Thread eb303
On May 27, 3:14 pm, Neil Cerutti wrote: > On 2010-05-27, eb303 wrote: > > > I've been using Python properties quite a lot lately and I've > > found a few things that are a bit annoying about them in some > > cases. I wondered if I missed something or if anybody

Re: Minor annoyances with properties

2010-05-28 Thread eb303
On May 28, 11:50 am, Christian Heimes wrote: > Am 28.05.2010 11:31, schrieb eb303: > > > > > On May 27, 3:24 pm, Christian Heimes wrote: > >>>  Do I miss something? > >>> Is this the way to do it, or is there a better one? > > >> A

Re: GUI programs

2010-05-31 Thread eb303
On May 30, 5:21 pm, "Alf P. Steinbach" wrote: > PS: Tkinter on its own does not provide image resizing and does not on its own > support common image formats like JPEG or PNG (it does support GIF). "Native" PNG support in tcl/tk and hence Tkinter is planned for the next release (8.6), which is in

Re: tkinter function outout to text widget

2010-05-31 Thread eb303
On May 29, 10:51 pm, Johan Lans wrote: > Hi > I'm totally new on python and I'm doing an assignement where I'm doing > a class that manipulates a text. The program is also supposed to have > a GUI, for which I have used tkinter. > So far I have entry widgets for file names and buttons, its all > w

Re: Tkinter library reference

2010-05-31 Thread eb303
On May 29, 3:11 pm, Pradeep B wrote: > Do we have a standard reference library for Tkinter available? > > -- > Pradeep Short answer: no, at least not a complete one for Tkinter itself. However, there is a complete reference for tcl/tk here: http://www.tcl.tk/man/tcl8.5/ Once you're used to conv

Re: Tkinter Toplevel sizing issue (using a grid)

2010-06-14 Thread eb303
On Jun 12, 1:40 am, random joe wrote: > Hello all, > > Hi this i my first post here. I would like to create a tkinter > toplevel window with a custom resize action based on a grid. From the > Tk docs it say you can do this but for the life of me i cannot figure > out how? In my app i wish for the

Re: tkInter Listbox question

2010-06-21 Thread eb303
On Jun 21, 7:36 am, Anthony Papillion wrote: > So I'm trying to add a Listbox to my window. I want it to be the width > of my window and the height of my window.  I'm using the following > code ('root' is my toplevel window): > > gsItems = Listbox(root, width=root.winfo_width(), > height=root.winf

Re: tkInter Listbox question

2010-06-22 Thread eb303
' is my toplevel window): > > > gsItems = Listbox(root, width=root.winfo_width(), > > height=root.winfo_height()) > > gsItems.pack() > > > While you would think this code would set the height and width of > > gsItems to the height and width of root, it doesn&#

Re: ttk Scale: missing attributes

2010-06-24 Thread eb303
On Jun 23, 7:26 pm, Alan G Isaac wrote: > Tkinter's Scale widget had a `label` and a `resolution` attribute. > These appear to be missing from the Ttk Scale widget. > Is there a reason?  These were important attributes. > > Thanks, > Alan Isaac As you might know, the new ttk widgets are not inten

Re: An assessment of Tkinter and IDLE

2009-08-28 Thread eb303
On Aug 27, 11:22 pm, r wrote: > - > Python offical docs and Tkinter > - > *The Python docs barely cover anything related to actual Tkinter > coding. At the minimum the Tkinter doc page should have a subpage for

Re: An assessment of Tkinter and IDLE

2009-08-31 Thread eb303
On Aug 28, 4:41 pm, r wrote: > Thanks eb303 for the wonderful post > > I have looked over the new ttk widgets and everything looks nice. I am > very glad to see the death of Tix as i never much liked it anyhow and > always believed these widgets should have been in the main Tkin

Re: New Tkinter windows don't get focus on OS X

2009-09-11 Thread eb303
On Sep 11, 9:14 am, Hendrik van Rooyen wrote: > On Thursday 10 September 2009 18:19:09 Joshua Bronson wrote: > > > True, but it'll still be a lot less painful for me to test my app if I > > can get it to steal focus > > when launched from the command line. If anyone knows how to do this in > > Tki

Re: New Tkinter windows don't get focus on OS X

2009-09-11 Thread eb303
On Sep 11, 10:40 am, Hendrik van Rooyen wrote: > On Friday 11 September 2009 09:53:56 eb303 wrote: > > > On Sep 11, 9:14 am, Hendrik van Rooyen > > wrote: > > > look for widget.focus_force() > > > and look for widget.grab_set_global() > > > Doesn&

Re: Tkinter - Text - bullets

2009-09-18 Thread eb303
On Sep 18, 11:57 am, Thomas Lehmann wrote: > My intention is to write a small custom widget displaying text where > the text can have a simple wiki syntax. The main interest is to > support heading, bold, italic, underline, itemization and enumeration. > > How can I implement itemization using the

Re: Tkinter - Text - bullets

2009-09-21 Thread eb303
On Sep 19, 5:53 pm, Thomas Lehmann wrote: > > Something like this maybe? > > > > from Tkinter import * > > > root = Tk() > > txt = Text(root, wrap='word') > > txt.pack() > > > txt.tag_configure('text_body', font=('Times', 18), lmargin1=0, > > lmargin2=0) > > txt.tag_configure('bulleted_list',

Re: Tkinter - Text - bullets

2009-09-22 Thread eb303
On Sep 22, 7:45 am, Thomas Lehmann wrote: > > This is probably why you had all these alignment problems. But it's > > weird, because the script I posted is copied and pasted from a really > > script that I've run, and which doesn't cause any error. What is the > > version of tcl/tk used by your Tk