Questions tagged as 'tkinter'

0
answers

Guess Game Python Tkinter

I created a code in Python to present a game of advection, numbers between 1 and 100. I wanted to implement this game in a graphical interface, using the Tkinter module. I had an idea, I created a code using tkinter, but after that I crashed. My...
asked by 07.08.2018 / 23:36
0
answers

How can I resize an image in tkinter?

I tried to do it this way but I could not search in the documentation and for what it seems there is .zoom () and .subsamble () I did not quite understand how it works. I could not deploy to my code from tkinter import * root = Tk() root.geo...
asked by 30.07.2018 / 02:57
0
answers

How do I get text from a textField in python and insert it in a window as if it were a Label?

I'm having this difficulty getting the TextField text and "printable it" in the Tkinter window Code: from tkinter import * from tkinter import messagebox import time jan = Tk() jan.title('KNOM OS') jan.geometry('1366x760+0+0') jan.configur...
asked by 15.07.2018 / 22:48
1
answer

Using Tkinter next to a Database

I'm doing a people registration program with interface (still pretty basic, just to do tests) and I'm having several difficulties: I am extracting the data using .get() , however, I can only type 1 character. If I type more then the fo...
asked by 04.07.2018 / 20:27
1
answer

Screens in Tkinter-Python

I'm having trouble getting back to one screen without creating another ... I could not get her to go back to the same canvas I created. Can I use .destroy() ? Here is the code: from tkinter import * def janela_principal(): janela1 =...
asked by 10.07.2018 / 05:53
1
answer

help with storing value of a local variable in python

Hello, well, I'm writing an application using SQLite and Python, everything was running fine until I had a problem that I can not solve, I happen to have a db of fipe, so I need to load 3 combobox with brand, model and year , then I decided to do...
asked by 02.07.2018 / 04:43
1
answer

___ ___ erkimt Python - Tkinter - Dynamic CheckButton not take the value of the variable when referenced from another file / screen ______ qstntxt ___

I'm having the following problem: I can get the value of a dynamic variable (checkbutton) when the whole program is in a single file with only one function:

%pre%

However if I separate the code into two files, each one on a screen and two modules, I can only get the 0 values of the checkboxes:

File 1: TwoWindows2

%pre%

File 2: TwoWindows2

%pre%

Can anyone help me with this?

    
______ azszpr313528 ___

Variables from the other file can be accessed normally if you import the other file - but not with the %code% syntax, and use the filename as a prefix:

For example, you could put all the variables in a file name %code% and use a line like this

%pre%

And inside that file you can access the variables with %code% and so on.

Your code is pretty messy, but sometimes doing is the only way to learn - I recommend a third file, why else can you to fall into a problem of circular import dependency, the way it is working.

Another note: The keyword "global" only makes sense within functions - and says that those variables within the function will be visible in that module (file) - (and thus will be visible from the other files using the form prefix, as I showed above): using "global" inside classes and outside functions does not make sense. (It would even make a difference, but one has to know a lot Python to know exactly what it is doing, and even then, it would hardly be the right way to do anything.)

    
___

I'm having the following problem: I can get the value of a dynamic variable (checkbutton) when the whole program is in a single file with only one function: import string from tkinter import * import tkinter as tk qtdvinhos = 3 linhacheck = 1...
asked by 11.07.2018 / 03:02
1
answer

Using screens in Tkinter-Python

Is everything okay with you? So, I'm doing a screenshot program, its function would just be a test consisting of: Open a screen (called by a button) and close the one that was open. I do not know how to do this, I have tried to use repetition lo...
asked by 06.07.2018 / 04:35
1
answer

Problems developing a bricks-breaking game in tkinter (collisions with objects)

I'm a few days studying and trying to get the ball by hitting the rectangles from above they add and invert the side from tkinter import * from constantes import * import random class Jogo(): def __init__(self): #Criar tel...
asked by 19.06.2018 / 14:29
0
answers

Relating button made in Tkinter, with graph generated in matplotlib

Good evening! I have the following code, which calls an excel table and converts it to a bar chart: import openpyxl import matplotlib.pyplot as plt book = openpyxl.load_workbook('planilha.xlsx') sheet = book.active celulas = sheet['A2':'B8...
asked by 29.06.2018 / 01:14