Posts by Carlos Magno • 64 points
13 posts
-
0
votes1
answer187
viewsA: How could I make an app that works in the background with python and kivy?
Try using the '.pyw' extension to not open the terminal. Loop the program and only open a Kivy window when the condition is true.
-
0
votes1
answer66
viewsA: pyautogui error, values
You can fix the problem by rewriting the sendMouse function, so that when sending the values, do so using a list and converted values into integers. That is, as follows:: def sendMouse(line): if ":"…
-
2
votes1
answer212
viewsA: Problem instantiating classes in Python 3
Your Classes are with the init misspelled. You are writing: class Cliente: def __int__ (self, nome, telefone): And the right thing would be: class Cliente: def __init__(self, nome, telefone):…
-
0
votes1
answer592
viewsA: How to pick a value from a certain attribute with Beautifulsoup
Try to use: soup.title In that case.
pythonanswered Carlos Magno 64 -
0
votes1
answer46
viewsA: Positioning a FORM on the page
In this case, I recommend applying a class to the first element, and editing it with CSS with float: left. article.form { margin: 15px; padding:15px; border: 1px #90ac6e solid; border-radius: 6px;…
-
0
votes4
answers1140
viewsA: How do you get a form down?
If you prefer, you could also use the property "position", with the value "relative" and resetting the position of the form from the top property. form{ position: relative; top: 10%; } However, the…
-
0
votes1
answer53
viewsA: How to insert a single right answer into the input tag?
If your goal is to open a particular web page according to the user’s response. This would be a possible solution: function change(value){ switch(value){ case 'exemplo2':…
-
1
votes2
answers722
viewsA: Extract multiple values from a single variable in python
You could also use a list to store the information, something like that: dia, mes, ano = input("Dia Mês Ano: ").split(' ') lista = [dia, mes, ano] It could facilitate the manipulation of this…
pythonanswered Carlos Magno 64 -
0
votes3
answers320
viewsA: I can’t fix this bug in Python, I’m a beginner
The correct one would be to transform both variables to the same type (in this case, or an integer or floating point). Something like this: trans1 = Float(price) trans2 = Float(usertap) However, the…
pythonanswered Carlos Magno 64 -
1
votes3
answers2390
viewsA: How to access a list resulting from one function in another?
In addition to passing as parameter or setting externally, you can also turn the list into a global variable. Example: def primeiro(): global lista lista = [0, 1, 2, 3] def segundo(): return lista…
pythonanswered Carlos Magno 64 -
1
votes2
answers3836
viewsA: How to access variables defined in another function?
You could also choose to use "global" within the function. This would allow you to view the variable within that scope. Example: def exemplo(): global X X = 'Valor da Variável' return X In this…
pythonanswered Carlos Magno 64 -
-1
votes3
answers646
viewsA: PYTHON FUNCTION(METHOD)
It should work like this: # Codigo do usuario c = 0 def menu(): print("----------------------------------------") print("----------Sistema de Cadastro-----------")…
-
0
votes2
answers682
viewsA: Automatically close browser after alert
You could do something like this: function alerta(){ alert('my msg'); } function fechar(){ window.close(); } #algo{ width: 100px; height: 100px; background: darkcyan; } <div id='algo'…