Posts by LucasV75 • 126 points
9 posts
-
1
votes1
answer133
viewsA: How to make a macro that clicks in several places?
Well, about doing it run a sequence of commands when you press a specific key or CTRL + Something for example you can do the following steps: First I’ll import: from pynput import keyboard to mess…
-
2
votes1
answer563
viewsA: How to make python code run again after running something?
There are several ways to do this: Loop with infinity with while True just remembering that this way you need to add a option or exit condition break the loop with the command break otherwise it…
-
3
votes1
answer104
viewsA: VS Code - Flake8
The problem is in: raio = input("Informe o raio: ") This is because you are not defining the variable type (int,str,float,bool) input will receive. By default python input will always receive a…
-
0
votes2
answers187
viewsA: How to avoid repeating code?
You can also replace the loop while calling the function again in places where it theoretically would not receive the desired input. I’m reusing the user92257 code from random import choice def…
-
0
votes3
answers655
viewsA: How to repeat these commands in Python
You can try to create a function for this as follows: Just going over: times represents how many times your code will run and intermission the time period between each execution. def…
-
0
votes1
answer340
viewsA: Window automatically closing Pysimplegui
The solution to this problem is simple, what happens is that as your code does not have a while loop to continue after performing an action within your GUI, such as collecting the past data and…
-
0
votes3
answers75
viewsA: Why is my code "swallowing" string on a list?
This is happening because at the time you’re giving letters.remove(letter) in its code the size of the list is being changed and consequently the index of all items in it is decreasing by 1. For…
-
2
votes1
answer92
viewsA: What’s wrong with this Python code?
Just swap the int with the place input. Your code at the moment is like this: Nam = input(int('Qual o numero (de 1 ate 9999)?')) The correct one would be to define the type of variable (str, Flot,…
-
0
votes2
answers47
viewsA: Login function does not access the register, which has already been entered
I corrected the error by replacing the list with a ICT, test there from time import sleep grupos = dict() opções = ["1 - Logar","2 - Cadastrar","3 - Sair"] def Logar(pessoas): usuário =…