Questions tagged as 'python'

1
answer

Error with requests with scrapy

I have a csv file with some urls that need to be accessed. http://www.icarros.com.br/Audi, Audi http://www.icarros.com.br/Fiat, Fiat http://www.icarros.com.br/Chevrolet, Chevrolet I have a spider to do all the requirments. import scrapy i...
asked by 09.09.2016 / 15:19
2
answers

How to use multiple languages in a single program?

I've seen that Google Chrome is done in Python, C ++ and Assembly and it came to mind, how to program using multiple languages in a SINGLE program?     
asked by 12.06.2016 / 18:48
2
answers

Make word search within a list and return ordered tuples in PYTHON

The algorithm should receive a string, count as many words as possible, and return a list of tuples with the words that appear the most in the string and how often it appears. The problem is that in searches are words that start out the same cou...
asked by 05.11.2016 / 12:01
1
answer

Compact and uncompress file in memory

I have several functions that read the file directly from a cache path , but eventually it will cost a lot of space on filesystem , is there any way to generate this file in memory and save it already zipped to disk? >     
asked by 10.01.2017 / 16:37
2
answers

How to remove spaces at the beginning and end of an XLS output

I have the code below, so it opens a spreadsheet in XLS and shows me the header. however I would like the left and right spaces to be removed and the internal spaces to be replaced by underline is there any function in xlrd that do...
asked by 18.11.2015 / 15:48
2
answers

How to access variables defined in another function?

I'm writing a program about the NIM game. It asks me to call functions inside another function, but when I try to compute variables belonging to this function in another function (the function that calls the one that contains the variable) an er...
asked by 20.10.2017 / 04:21
1
answer

How to get different outputs (fasta) files with unix or python

I have a fasta file that has several gene sequences, such as: >gene1 C.irapeanum 5.8S rRNA gene CGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTGATGAGACCGTGGAATAAACGATCGAGTG >gene2 C.irapeanum 5.8S rRNA gene AATTTCAAGGTTTCCGTAGGTGAACCTGCGGAAGGA...
asked by 02.02.2017 / 17:32
1
answer

How to block the resizing of a widget / window?

I'm setting a particular widget according to the size of the secondary monitor. This I was able to do perfectly. However, since I'm new to PyQt, I'd like to know how to block the resizing of the window. I mean, I want the user not to be ab...
asked by 17.10.2016 / 18:14
2
answers

How to know if request.FILES is empty?

I have a code in Django where I want to upload a file from a form. At any given moment, I need to check if the index "arquivo" exists within the variable request.FILES I did this using the has_key method as foll...
asked by 05.02.2015 / 18:48
1
answer

Search for nested list elements

I have a problem with a code. I have to find a specific element (I know which element it is but I do not know its position because it is random). Under normal conditions, I would use a index and would easily get the position. The problem...
asked by 19.03.2015 / 19:17