Posts by Rodrigo Nogueira • 576 points
12 posts
-
1
votes3
answers170
viewsA: Remove the brackets from the Sorted() function
You can use the function join print(f"A função tem duas raízes reais, que são: {','.join(str(v) for v in sorted(raizes, key=int))}.") In the above change, first the list returned by sorted has its…
pythonanswered Rodrigo Nogueira 576 -
1
votes1
answer99
viewsA: Return of a for in a python list
In your code, you’re recreating lista at each iteration. Put a print(lista), as below, and you will see what is happening. for i in glob.glob("C:\Backups\Logs\*.0000*"): lista = [i] print(lista) The…
-
5
votes3
answers138
viewsA: The why of using break
The break ends the running repeat loop and continues on the next instruction after this repeat loop, either a loop designated by while or for. In your case, the break is finishing the loop while pos…
-
0
votes5
answers15940
viewsA: How to create a directory in Python?
Although the previous answers are correct, from Python 3.4 give preference to the use of pathlib. In documentation and in the PEP 428 the reasons for. Example: Little of the Functionality from…
-
2
votes1
answer171
viewsA: How to run a virtual python Environment on the linux crontab?
Just use the full path to python installed in virtualenv. 30 08 10 06 * /home/venv/bin/python3 /<caminho_do_script>/Scripts/test.py You can also create a . sh script that enables virtual…
-
0
votes2
answers507
viewsA: Change List with a python function
You can also use the function range: print("===================== EX-01 ================") magicos = ["Mario", "João", "Maria"] '''Exibe uma saudação aos magicos''' def nomes_dos_magicos(): for i in…
-
0
votes2
answers143
viewsA: Dictionary doubt
Looks like you want to work with the dictionary keys in the loop for. In this case, use: for pessoa in agenda.keys():
-
1
votes1
answer406
viewsA: Long running period web service
For the customer to know how long it will take, you need to send an answer. This type of problem can be adequately addressed using an asynchronous approach. There are advantages to doing this. For…
-
1
votes1
answer474
viewsA: Implementation using API-Streams and API-Lambda Java 8
A possible solution to follow. It has no ideal architecture and performance, but illustrates several elements of Java 8, within the constraints of the question. Product class: package…
-
4
votes1
answer109
viewsA: Have the functional features of Java 8 made any Pattern design obsolete?
After Java 8, we often see this controversy about saying that some classic Patterns have become obsolete. A Pattern encodes what is considered best practice for a type of problem, but not all…
-
15
votes2
answers18808
viewsA: What’s a pull request for?
Pull request is a mechanism where a developer can generate a notification that signals the completion of any Feature development. This lets everyone involved know that they need to merge the code…
-
7
votes3
answers569
viewsA: What are the consequences of programming in 32 bits or 64 bits?
Besides memory, there are other yes: Dlls are loaded into applications with equivalent bits. If you try to load a 32-bit DLL into a 64-bit application, the exception will be launched…