Posts by Cleyton • 191 points
18 posts
-
1
votes1
answer38
viewsA: receive an object in a method of the same type as the method class
In python you need to do the test inside the method/constructor, ex: class TreeNode: def __init__(self, pai): if not isinstance(pai, TreeNode): print('Nao Ok') else: print('Ok')…
-
0
votes1
answer193
viewsA: Manipulating String while true PYTHON
You can use dictionary to save the data of each student, use a list to save them and when the user finishes typing, you make an iteration in the student list to display the final result, e.g.: #…
-
0
votes2
answers172
viewsA: Delete a row and column range in python?
You can use the keyword "OR" to filter the lines in the IF: IF row nr is equal to 0 (header) OR row nr is between the desired range: import csv in_file = open("Downloads/Dados_PNBoia/B116353.csv",…
-
2
votes1
answer136
viewsA: Trasformar Datraframe in Dicionario
Method to_dict(), ex: df.to_dict()
-
0
votes4
answers17442
viewsA: Python sum operation
Maybe that would be? numero1 = int (input("Digite o primeiro numero: ")) # 1 numero2 = int (input("Digite o segundo numero: ")) # 3 nrSaida = len ( range(numero1 ,numero2) ) + 1 print(nrSaida) # 3…
-
1
votes1
answer51
viewsA: Problems when creating lists
Yan, it is possible to do this in two ways without opening another loop within the first "for", example: 1) Using the list (doc) The Dice is sequential numeric : import os infos = [] for fileFound…
-
2
votes1
answer92
viewsA: How to replace by following a pre-determined python pattern
You can simply create an input to scroll through the desired list within the "for" and reset it when it reaches the list size by restarting the list, example: import fileinput file_name = 'GH.txt'…
-
0
votes2
answers167
viewsA: Fetch information from a td by jquery
See if that helps you: $(document).ready(function() { $("button").click(function() { $ar_tr = $('table[id=MinhaTabela] tr'); $.each($ar_tr, function(i, $tr){ input_idchecklist =…
-
1
votes2
answers55
viewsA: Click the button and show only date and time
Using function demonstrated in another answer in English (source here) function formatDate(date) { var monthNames = [ "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto",…
javascriptanswered Cleyton 191 -
0
votes2
answers313
viewsA: Calculate the average of a field in a specific year within a period
From what I understand, you need to know the average salary of the employee year by year. If so, it is possible to use the command "group by" ex: SELECT YEAR(from_date) AS ano , AVG(salary) AS media…
-
1
votes1
answer44
viewsA: How to create a list that has two mini lists inside it
It is possible to do this in several ways, Python is great to work with lists: >>> lista = [] >>> mini_lista1 = [] >>> mini_lista2 = [] >>> >>>…
python-3.xanswered Cleyton 191 -
0
votes1
answer50
viewsA: Open new page automatically in php with result from previous page
In your search form you need to define the property "action" with the address of the destination page, ex: <form action="/resultado.php" method="POST"> <input type="text"…
-
0
votes1
answer543
viewsA: Tkinter Python screens
Tk opens a window when you create an instance of it and not in the mainloop() method. You need to instantiate Tk within the constructor of the Serve class and when you click the open() function…
-
0
votes2
answers542
viewsA: Django - Questions with Foreignkey
I’m analyzing your architecture. If the same project cannot be in more than one company and a version belongs to only one project, it is possible to eliminate the "company" field of the Version…
-
0
votes1
answer27
viewsA: I try to make a request ajax but it does not send any dice
Dear your question this energy too. Try to develop in a modular way, testing each part separately. puts a console.log( $("#text_description"). val() ) before the ajax request to be sure the correct…
-
0
votes1
answer75
viewsA: I can’t get user id value
Tried to pass the parameter the same way as the other $start and $end parameters ? Thus: $result = mysqli_query($connection, "SELECT `id`, `start` ,`end` ,`title`,`ativo`,`atendente` FROM `events`…
-
1
votes1
answer292
viewsA: oracle SELECT ... FOR UPDATE with PHP
Have you considered using an Oracle Sequence? You can create a Quence and then call her nextval, it auto-increments by itself: Ex: Create a seat in the bank (documentation) CREATE SEQUENCE…
-
1
votes2
answers1005
viewsA: When finishing the script with "Ctrl+C" (Keyboardinterrupt) does not close Selenium Firefox
Try treating the Keyboardinterrupt exception when running the program, e.g.: try: w = WhatsappAPI() w.comeca_acao() except KeyboardInterrupt: w.driver.quit() print "Ate logo!"…