Tkinter List of Canvases

2020-11-10 Thread ChalaoAdda
Hello, I have a list of canvas of images. I would like to display all the images. But it displays the last image. Here is my code. from tkinter import * from PIL import Image, ImageTk root = Tk() canvas_width = 265 canvas_height = 130 canvases = [] r, c = 0, 0 for tile in tiles: img = ti

Re: Tkinter List of Canvases

2020-11-10 Thread ChalaoAdda
On Tue, 10 Nov 2020 17:21:04 +, MRAB wrote: > On 2020-11-10 10:01, ChalaoAdda wrote: >> Hello, >> >> I have a list of canvas of images. I would like to display all the >> images. But it displays the last image. Here is my code. >> >> from tkinter imp

tkinter global variable

2020-11-13 Thread ChalaoAdda
Hello, I am trying to read a file from askopenfilename outside the function. I am getting blank file name. What am I doing wrong? Here is my code. from tkinter import * from tkinter import filedialog def on_openfile(): global pic pic = filedialog.askopenfilename() root = Tk() menubar

Re: tkinter global variable

2020-11-13 Thread ChalaoAdda
On Fri, 13 Nov 2020 15:41:20 +, Stefan Ram wrote: > ChalaoAdda writes: >>I am trying to read a file from askopenfilename outside the function. I >>am getting blank file name. What am I doing wrong? Here is my code. > > It is possible that you try to read from &quo

Re: tkinter global variable

2020-11-13 Thread ChalaoAdda
On Fri, 13 Nov 2020 16:04:03 +, Stefan Ram wrote: > ChalaoAdda writes: >>On Fri, 13 Nov 2020 15:41:20 +, Stefan Ram wrote: >>> ChalaoAdda writes: >>>>I am trying to read a file from askopenfilename outside the function. >>>>I am getting blank fi

Re: tkinter global variable

2020-11-13 Thread ChalaoAdda
On Fri, 13 Nov 2020 12:04:53 -0500, Richard Damon wrote: > On 11/13/20 11:42 AM, ChalaoAdda wrote: >> On Fri, 13 Nov 2020 16:04:03 +, Stefan Ram wrote: >> >>> ChalaoAdda writes: >>>> On Fri, 13 Nov 2020 15:41:20 +, Stefan Ram wrote: >>>>&g

Re: tkinter global variable

2020-11-13 Thread ChalaoAdda
On Fri, 13 Nov 2020 18:40:53 +0100, David Kolovratník wrote: > On Fri, Nov 13, 2020 at 05:12:10PM +0000, ChalaoAdda wrote: >> On Fri, 13 Nov 2020 12:04:53 -0500, Richard Damon wrote: >> >> > On 11/13/20 11:42 AM, ChalaoAdda wrote: >> >> On Fri, 13 Nov 2