Questions tagged as 'python'

1
answer

Edit django widgets

Hello! I'm developing a Django application. On the project registration page there is a SelectMultiple pro user to select the participating teachers. But on the details page I just wanted to see the names of the teachers who were selected in the...
asked by 16.03.2016 / 16:16
1
answer

How not to repeat values in a list in Python?

If I create two lists, and then I add the two, I create a third one that has all the items of the previous two: >>>a = [1, 2, 3] >>>b = [3, 4, 5] >>>c = a + b >>>print c [1, 2, 3, 3, 4, 5] How can I preve...
asked by 19.03.2016 / 03:03
3
answers

Make copies of lists in certain positions with Python

Hello, please, I would like to copy a certain list in python. The total size of the list is 150 and I want to remove the last 50 items from the list. Here I will represent a list 100 times smaller, that is to say with 15 elements and that I want...
asked by 17.07.2016 / 03:39
2
answers

Implement abstract method in inheritance in Python

The following class hierarchy, where class "A" has an abstract method called "foo": # -*- coding: utf-8 -*- import abc class A: __metaclass__ = abc.ABCMeta def __init__(self): pass @abc.abstractmethod def foo(self):...
asked by 01.12.2015 / 21:31
1
answer

Is there a performance difference between Tuple and List?

In Python, I know there is a difference between a Tuple and a List . The Tuple is immutable, and the List , changeable. You may already have this question here: What is the main difference between a Tuple and a List...
asked by 16.11.2016 / 16:41
2
answers

I can not enter user-defined values in SQLite

I have a problem where I can not add anything to the table and the error always appears:    sqlite3.InterfaceError: Error binding parameter 0 - probably   unsupported type. The code I'm trying to add values to and this: p_name=input("...
asked by 30.01.2016 / 14:58
1
answer

Which component to use in PyQt4 to display records of an SQL query on the screen?

I'm developing a graphical desktop application in Python using PyQt4 (Qt Designer), my doubt is about which component to use to display on my screen frmTelaPesqAluno records of a SQL query, and how to use it? It is a component similar...
asked by 30.08.2015 / 20:46
2
answers

Read the last 5 lines of a file via Python

I asked this question here in Stackoverlow View the last 5 lines of a file with PHP? Now I would like to know how I could do the same thing in Python. How could I get the last 5 lines of a large file, without having to fully load it into...
asked by 03.09.2015 / 22:59
1
answer

Is there any way to disable the Scrapyd web interface?

Is there any way to disable the Scrapyd web interface? I would like to be monitoring the server only by the api.     
asked by 11.09.2015 / 15:09
1
answer

Nested Functions in Python

How do I do nested functions in Python? Another question, because I always need to use the self parameter, and have I already put parameters in the function? For example, it is considered that the function generate_individual () is already im...
asked by 19.06.2016 / 21:52