Posts by Matheus Saraiva • 2,157 points
108 posts
-
1
votes1
answer29
viewsQ: Stop Generator
What would be the best way to stop a Generator? Example: >>> def get_fruits(): fruits = ['Mamão', 'Abacate', 'Melão', 'Banana', 'Maçã', 'Uva'] for fruit in fruits: yield fruit >>>…
-
5
votes1
answer73
viewsQ: Serialization of exceptions
According to the msdn documentation, an exception should be serialized if it should be propagated outside the Assembler. In visual studio, I have a solution with some projects, among them a class…
-
1
votes1
answer1846
viewsQ: Sqlitestudio types of data
I’m using Sqlitestudio to model a database. When creating the fields of a table, I noticed that it has some data types that do not appear in the Sqlite documentation. For example, in the combobox…
-
1
votes1
answer202
viewsQ: What is the lifetime of a variable in the method, class and module?
I know that a variable declared in a method lasts for as long as the scope of the method. How python has the concept of class variables, until when lasts a variable declared in the class? And a…
-
1
votes2
answers1150
viewsQ: Pass pythonic form parameters
The database driver I am using returns the data of a record in the form of an example tuple ('João', 32, False). I’m thinking of a pythonic way of passing this data to the constructor of a Person…
-
2
votes1
answer470
viewsQ: PSYCOPG2 - Pagination
In the search for how to make paging using psycopg2 I discovered the attributes cursor itersize. and cursor., and the methodscursor.fetchmany() and scroll cursor.() I wanted to check with the staff…
-
4
votes1
answer578
viewsQ: Handle services with powershell
I created a script to start and stop a service. My intention is to be able to start or stop a service by simply clicking on a desktop shortcut. I created a shortcut for the script and in the…
-
0
votes1
answer105
viewsQ: psycopg2.pool.Simpleconnectionpool, Operationalerror exception takes time to launch
I ran a test, shut down the server and called the method psycopg2.pool.SimpleConnectionPool, the method is waiting for a response for a very long time, about a minute, only then it raises the…