Posts by Afonso Medeiros • 498 points
13 posts
-
2
votes1
answer47
viewsA: how to trigger a function via another function
def start(): print("oi") def chronus(): agora = hora.get() now = (datetime.datetime.now()) if agora == now: start() else: It usually works that way.…
-
1
votes1
answer146
viewsA: Serialize in flask-marshmallow with relationship
Of documentation: https://flask-marshmallow.readthedocs.io/en/latest/ Of the answer to that question: https://stackoverflow.com/questions/44511079/flask-sqlalchemy-marshmallow-nesting You need to…
-
1
votes1
answer39
viewsQ: Relationship Problems Entity Framework Core 3,
I’ll expose the code first, then explain the problem. Pupil.Cs using System.Collections.Generic; namespace SalaDeAula.Models { public class Aluno { public int AlunoId { get; set; } public string…
-
1
votes1
answer57
viewsA: Relationship Problems between "Table" and Django User
Well, I’m a beginner in Django so I’ll forgive myself for making these banal mistakes. But I found the answer. It turns out that Django when using the form.save(commit=False) it does not save what…
-
1
votes1
answer57
viewsQ: Relationship Problems between "Table" and Django User
I am working with Django to develop an application for a Help Desk, I have the following situation: I have a table named "Unit" that will be the table responsible for separating my systems into 4 or…
-
0
votes1
answer54
viewsA: Python Subprocess checking whenever a new file is added
I decided to put a time.sleep(0.2) at the end of while, the process has dropped from 98% to 0% of the CPU’s content and when it has many files to be sent to the server it varies from 3% to 0.2%…
-
0
votes1
answer54
viewsQ: Python Subprocess checking whenever a new file is added
Need: I need to "observe" a directory, every new file inserted in this directory I need to make a copy of this file and forward to an FTP server. What I got: I can upload the file via FTP, and I can…
-
0
votes2
answers123
viewsA: Query with date range with a variable
Searching in a time interval with the command below, all records will be returned within this period. SELECT * FROM table_name WHERE coluna_data BETWEEN 'data01' AND 'data02'; As this bringing only…
sqlanswered Afonso Medeiros 498 -
0
votes1
answer1720
viewsA: Read data from an Sqlite 3 database in Python
I did this way, I believe it is the simplest, uses more Python code than SQL resources. import sqlite3 conn = sqlite3.connect("teste.db") cursor = conn.cursor() cursor.execute("create table if not…
-
1
votes5
answers11566
viewsA: How to find the type of a variable given by the user?
Colleague, using the Eval() method it is possible to take and interpret the value of the data inserted in the variable. Example: numero = input() try: if type(eval(numero)) == type(1): print("tipo…
-
20
votes3
answers14315
viewsQ: Pythonic way of defining setters and getters
Searching the internet, I see that it is highly recommended not to use Setter and Getters in Python classes. However, I cannot determine a way to access private values without using them. There are…
-
2
votes3
answers603
viewsA: How to check any received type (upper or lower case)?
I don’t know much about C++, but if you don’t need to keep formatting the way it was typed you could use a method to turn letters into uppercase, if I’m not mistaken C++ uses the toupper(var) method…
c++answered Afonso Medeiros 498 -
7
votes1
answer5427
viewsQ: How to configure apache2 for python 3.5.2
I have been trying to study web programming with Python, but I can’t configure the server on my computer, can anyone help me? Whether it’s telling me how to set up or providing me with an already…