Re: [Tkinter-discuss] Moving object on page leaves afterimage on Python 3 but not on 2

2016-02-05 Thread Reinis Danne
On Fri, Feb 05, 2016 at 10:03:51PM +0530, Bhaskar Chaudhary wrote: > Hi Reinis Danne > > I am not sure if this is exactly the cause of your problem, but > map() returns a list in Python 2 but an iterator in Python 3. > > You can place a list around map() like: >list(map(self.paper.delete, it

Re: [Tkinter-discuss] Moving object on page leaves afterimage on Python 3 but not on 2

2016-02-05 Thread Reinis Danne
On Fri, Feb 05, 2016 at 05:03:50PM +0100, Michael Lange wrote: > > Personally I hardly ever use map(), so I never noticed that. In fact this > change is actually documented, see > https://docs.python.org/3.0/whatsnew/3.0.html#views-and-iterators-instead-of-lists > : > > "map() and filter() retur

Re: [Tkinter-discuss] Moving object on page leaves afterimage on Python 3 but not on 2

2016-02-05 Thread Bhaskar Chaudhary
Hi Reinis Danne I am not sure if this is exactly the cause of your problem, but map() returns a list in Python 2 but an iterator in Python 3. You can place a list around map() like: list(map(self.paper.delete, items)) to ensure that the result is still a list and has the same behavior in both

Re: [Tkinter-discuss] Moving object on page leaves afterimage on Python 3 but not on 2

2016-02-05 Thread Michael Lange
Hi, I'm glad you finally got it working! On Fri, 5 Feb 2016 16:56:58 +0200 Reinis Danne wrote: (...) > Replacing this: > map(self.paper.delete, items) > > with this: > for i in items: > self.paper.delete(i) > > fixes the problem. > > I don't understand why the difference. That code is eq

Re: [Tkinter-discuss] Moving object on page leaves afterimage on Python 3 but not on 2

2016-02-05 Thread Reinis Danne
On Fri, Feb 05, 2016 at 10:29:42AM +0100, Michael Lange wrote: > Hi, > > On Thu, 4 Feb 2016 14:58:11 +0200 > Reinis Danne wrote: > > > To test: > > $ git clone https://gitlab.com/bkchem/bkchem.git > > $ cd bkchem > > $ git submodule init > > $ git submodule update > > $ python3 bkchem/bkchem.py

Re: [Tkinter-discuss] Moving object on page leaves afterimage on Python 3 but not on 2

2016-02-05 Thread Michael Lange
Hi, On Thu, 4 Feb 2016 14:58:11 +0200 Reinis Danne wrote: > To test: > $ git clone https://gitlab.com/bkchem/bkchem.git > $ cd bkchem > $ git submodule init > $ git submodule update > $ python3 bkchem/bkchem.py this looks like quite a complex piece of code. Is it possible for you to provide a s

[Tkinter-discuss] Moving object on page leaves afterimage on Python 3 but not on 2

2016-02-04 Thread Reinis Danne
Hi! I'm porting a chemistry drawing program BKChem [1] to Python 3 using the shared codebase between versions 2 and 3. It is working fine on Python 2, but if I run it with Python 3 I have an issue with redrawing the page. The issue is that if I move an object by mouse then it leaves an image of t