Questions tagged as 'python'

1
answer

BeautifulSoup - Real href links

I was studying about WebScraping with Python and started using the bs4 library (BeautifulSoup). When I started to get the tags a and the href attribute, I realized that I could not access the link if in href had something li...
asked by 07.11.2017 / 08:58
1
answer

How to integrate and make queries with pymongo?

I'm learning to integrate Python and MongoDB, and because of that, I set myself a challenge: to create a small program to register football players. My program has two modules, info_player and info_team. My intention is to run the program int...
asked by 07.11.2017 / 12:06
1
answer

MemoryError in pandas

Hello I am using the pandas merge command in python3: ibama_doadores_orig = pd.merge(eleitos_d_s_doadores, ibama, left_on='CPF_CNPJ_doador_originario_limpo', right_on='CPF_CNPJ_limpo') But a message of MemoryError appears: ---------------...
asked by 05.10.2017 / 14:24
1
answer

Images with Django - display and static

I'm a beginner in Django and I'm developing a simple blog. I know that the configuration of the static files needs to be different for the development and production environment, but I always get caught up in understanding how it works sin...
asked by 04.10.2017 / 17:40
1
answer

Passing a list of objects to a dictionary in python

I have a list of objects: lista_objetos = ['acarreta', 'afeta', 'alavancagem', 'apropriadas', 'arvore', 'avaliacao'] Each object stores information, including the information itself, eg: afeta.palavra is equal "afeta" ....
asked by 08.11.2017 / 13:05
1
answer

Save binary variable in list mode

How can I save the binary variable in horizontal line type list mode with all the values that come out in the binary variable. for n in receivedMessage: contador += 1 print (contador) binario=list(dec_to_bin(n))# assim sai cada val...
asked by 27.09.2017 / 11:24
1
answer

How to avoid repeating code?

I have a script in Python 3 that tries to be a chatbot, where it has several if and elses that are used based on what the user responds to. The problem is that in all functions, type get_name () or get_age () , these if and else are...
asked by 30.09.2017 / 23:00
1
answer

How to use objects.filter in django?

Good afternoon, I have a model here in my django Subject, and I want to make the listing of it in the html, however every subject has as foreign key the id of the model category, as I make a variable to receive the objects.filter only of the sub...
asked by 24.11.2017 / 15:46
1
answer

Program closing immediately after opening (Post compiled)

I'm starting to study Tkinter and compiling, and I have a basic notion of Python, and I'm having some problems. Here is an example of a basic program that, after compiling, the executable just opens a cmd and closes, without any kind of response...
asked by 14.10.2017 / 01:12
1
answer

Function remove threaded list

Algorithm remove_first(L): if L.head is None then Indicate an error: the list is empty. L.head = L.head.next L.size = L.size−1 I was left with doubt about memory leak. Since the removal of nodes seems to work o...
asked by 14.10.2017 / 02:44