Posts by Nathan Schroeder • 458 points
25 posts
-
1
votes4
answers1706
viewsQ: Functions of PYAUTOGUI not working
I am automating the installation of software using python with pyautogui: import pyautogui import time import pyperclip for window in pyautogui.getWindows(): pyautogui.getWindow(window).minimize()…
-
1
votes1
answer120
viewsA: Perform functions within an array, after a given index, and another for the others
Here below follows the demonstration using 1 array, to use the second, just copy and change some variables. I tried to explain the code with comments, any doubt do not hesitate to ask. array1 = [];…
javascriptanswered Nathan Schroeder 458 -
2
votes2
answers71
viewsA: Variable value in PHP
Use a array to store items, so you can do this: $itens = array(); $produtos = array(); $descricoes = array(); for($i = 0; $i <= $qtdProd ; $i++){ $itens['a25Item'.i]=$_GET['a25Item'.i];…
-
-1
votes2
answers344
viewsA: name is not defined - name/variable undefined, Tkinter and slite3 help
By indications of professionals, I always recommend to define the methods before the rest of the program (although it is not necessary, do as you wish). Because it is using classes, it is necessary…
-
1
votes1
answer1358
viewsQ: Access Denied when trying to delete directory with PYTHON
I have several folders, and within these, several other folders, and I need to enter one in order to delete other folders (Yes, there are many nested folders). The name of the folders that I should…
-
0
votes1
answer1064
viewsA: Time between two dates
Here is the solution, not complete because it needs validations, I’ll leave it to you. from datetime import * data1 = input("Digite a primeira data em formato dd/mm/aaaa: ") data2 = input("Digite a…
-
2
votes3
answers3905
viewsA: Usable but invisible input
<script> if(type=sac){ $('#tipo').value('sac'); }else if... </script> <form action="page2"> <input type="hidden" id="tipo"> <!-- Existe o input type "hidden", que é…
-
0
votes3
answers1041
viewsA: Sort sequence of numbers from a TXT file
Create the file: Code: arquivo = open('C:/Users/Usuario/Desktop/numeros.txt','r'); #Abre arquivo no modo 'read'. linha = arquivo.readline() #lê uma linha do arquivo arquivo.close() #Fecha o arquivo…
-
0
votes1
answer93
viewsA: How to insert data from a form made in Angular2 in a database?
The solution to this problem using xampp is: Place all PHP files in the htdocs folder of xampp. Develop the web application and use the command ng build to compile the system. Take the 'dist' folder…
-
-1
votes1
answer93
viewsQ: How to insert data from a form made in Angular2 in a database?
I’m starting to learn Angular 2, and I have to do a CRUD of a system over series, and I need to store data in a database, currently I know how to use Mysql using Xampp. I need to make the request…
-
-1
votes2
answers103
viewsA: String for date and day subtraction javascript
There is the method stepDown(qnt) which reduces the amount of days of input type=date <html> <body> <input type="date" id="data"> <!-- Pega a data --> <button…
javascriptanswered Nathan Schroeder 458 -
1
votes2
answers56
viewsA: Ignore first input reading
You can take the class form-control of <input type="hidden" class="form-control" value="Não é pra aparecer">, for thus, he will not be called by: document.querySelectorAll('.form…
javascriptanswered Nathan Schroeder 458 -
2
votes3
answers8232
viewsA: A register of people in python
Option 2: To format prints you can do so: elif op == 2: for mostrar in listas: try: print("Nome: %s - Idade: %s - ID: %s"%(mostrar[1],mostrar[2],mostrar[0])) except: print("Essa pessoa não possui…
pythonanswered Nathan Schroeder 458 -
4
votes1
answer33
viewsA: Does not satisfy the condition with the value informed by the user
The entrance input() makes the user type a string, for this reason, when you compare op == 0 you are comparing a string with an integer. To solve this you have 2 options: 1st: op = input() if op ==…
pythonanswered Nathan Schroeder 458 -
3
votes2
answers444
viewsA: How do I assign the last value of an array to a variable?
There is the possibility to use positions reversed, array[-1], array[-2], and so on. Example: array = [1,2,3,4,5] print(array[-1]) #O retorno será '5' print(array[-2]) #O retorno será '4' So:…
pythonanswered Nathan Schroeder 458 -
-1
votes4
answers685
viewsA: Only put the correct message print once
In its code, for each correct character, it prints, for this reason, the program must print only when the entire CPF has been validated, follows an example below: def verificarNumeros(cpf): #FUNÇÃO…
-
1
votes1
answer1321
viewsA: Angular 5 , Mapping an array of Objects within another array of Objects
Because the contents are of the Conteudospraticararray type[] (conteudos: ConteudosPraticarArray[];), and this last being an array of Objects, you need to access it as well as access the id_assunto…
-
0
votes4
answers79
viewsA: Show div/form when user selects an option
Instead: $(document).ready(function() { document.getElementById('test').addEventListener('change', function () { if (this.value == 2) { var style = this.value == 2 ? 'block' : 'none';…
-
1
votes2
answers1214
viewsA: Levels in the game of old
To repeat several times and choose the difficulty: jogando = True while jogando: #Você pode criar uma função que dê print o menu e retorne a dificuldade ou sair print("Dificuldades:") print("1 -…
pythonanswered Nathan Schroeder 458 -
1
votes1
answer104
viewsA: Try-except, Indexerror, Alternatives to fix the error
The len returns a value starting from 1, not 0. However, the counting of positions starts from 0. while i<=len(bolas): Let’s assume that the len(bolas) is equal to 10: The positions of the balls…
-
0
votes5
answers7817
viewsA: Sum of each element of two lists
This code only works if array A is the same size or smaller than array B: a=[1,2,3,4] b=[2,4,5,6] d=[] for x,y in enumerate(a): # Percorre o Array a enumerando suas posições d.append(y+b[x]) #…
-
0
votes1
answer901
viewsA: Multiselect in dropdown format in Bootstrap 4
Try: <select class="selectpicker" multiple> <option>Mustard</option> <option>Ketchup</option> <option>Relish</option> </select> Source:…
-
0
votes2
answers391
viewsA: Satisfaction survey form
I believe INSERT has an error: INSERT INTO pesquisa_satisfacao SET nome = ?, cpf = ?, telefone = ?, email = ?, nota = ?, nota_comentario = ?, relacao_hospital = ?, servicos = ?, alaviacao_1 = ? ,…
-
1
votes1
answer307
viewsA: How to make my menu work on all pages
Are you using some framework to do it? I think you’re forgetting to add some of these lines in <head> of the other pages: <link rel="stylesheet" href="css/bootstrap.min.css"> <script…
-
-1
votes2
answers1443
viewsA: To fill a Select dropdown based on the value of another select, the data comes from the same table in db
You can use AJAX to request and return database values with JS: ajax = new XMLHttpRequest(); ajax.onreadystatechange = function() { if ((ajax.readyState == 4) && (ajax.status == 200)) {…