Posts by Gabriel Gregório da silva • 78 points
12 posts
-
0
votes1
answer84
viewsQ: How to work with super accurate Python values?
I’m creating an algorithm and I’m encountering a strange problem, I have a set of precise values and an unknown goal, basically a neural network. I used several tactics to optimize weights and now…
-
0
votes2
answers360
viewsA: Extract information from a tuple and place in different variables
[Edit 2] From what I see, Python is returning a list[], within this list, it has several tuples(), and within tuples it has values. Good you can do so. # Vou considerar que o seu retorno é este:…
-
0
votes1
answer832
viewsA: Date query in python calendar?
Responding only to the title. Welcome to stackoverflow Rodrigo, you can use the datetime library and import the datetime. Take a look at this code for Python 3. # importação da biblioteca datetime…
-
1
votes2
answers43
viewsA: Remove gray squares from my Tkinter program (Python)
You want to remove only the color, right? If yes, just change the "Grey" color of that spot: root.configure(background='yellow') FrameABC = Frame(root, bg="grey", bd=20, relief=RIDGE)…
-
0
votes2
answers3404
viewsA: Take a Tkinter entry and save to a variable
So an alternative is to use a global variable. You can capture the input data and save it to a global variable, and then use it anywhere in the code. See this example I did: try: from tkinter import…
-
0
votes2
answers1013
viewsA: How to initialize this Tkinter Photoimage function?
Well, from what I understand, you want to put an image in your interface, if that’s right, this is a minimum code for you to add an image in your interface. try: from tkinter import * except: from…
-
1
votes1
answer485
viewsQ: How to capture parameters of the object that called an event in Tkinter?
I have 3 buttons, two with the same name and one with different name and each with its properties, I would like to know how to capture the text of each button in the same definition. Of course, I…
-
0
votes2
answers241
viewsA: Check continence python list
About verifying that all the elements of list 1 are contained in list 2, you can create a for to walk through all the elements of the list 1 and use a in to analyze if they are in the list 2, if…
pythonanswered Gabriel Gregório da silva 78 -
3
votes3
answers661
viewsA: Doubt - insert element at the end of the list - (Python)
So Leonardo, you need to call the function .append() after the list variable, like this(In Python 3): lista = [1,2,3,4,5] print(lista) # Resultado: [1, 2, 3, 4, 5] lista.append(6) # Resultado: [1,…
pythonanswered Gabriel Gregório da silva 78 -
1
votes2
answers534
viewsA: Check if a sequence of numbers is present in another
[ Updated answer ] I made this code below that walks through a variable of X positions X times, that is, a variable of 5 positions is analyzed 25 times and at each time it checks the…
pythonanswered Gabriel Gregório da silva 78 -
0
votes1
answer169
viewsA: raise Valueerror("Unknown url type: %r" % self.full_url)
I know what you’re doing wrong, the sites are not composed only by the name + ".com.br"(depends), the sites are composed this way(Also depends): protocol + "www." + name + domain, is more or less…
pythonanswered Gabriel Gregório da silva 78 -
0
votes3
answers627
viewsA: pass list of one method to another in python
If you want to pass a list within a definition x for a definition y, know that a variable created within a definition, is by default local, I mean, it only works in there. You can create a global…