Questions tagged as 'python'

1
answer

Capture using Xpath

I'm doing a capture of a site using python (scrapy) and xpath How to capture only 232.990 of the code below? <div class="price-advantages-container"> <div class="price-comparison"> <div itemprop="price" class="pri...
asked by 28.08.2018 / 20:34
1
answer

Bubble Sort in Python3

def bubble_sort(list): for i in range(len(list)): for j in range(len(list)-1): if list[j] > list[j+1]: list[j], list[j+1] = list[j+1], list[j] else: continue I just did this bubble sort, but I...
asked by 04.07.2018 / 14:55
2
answers

Output not expected in the file (infinity loop) CSV Python

Well, I'm trying to save the distance and time as a result of the difference in the sending / receiving time of ultrasonic sound, through the sensor for Raspberry Pi 3 HC-SR04! After getting these values to draw charts with the SeaBorn librar...
asked by 06.07.2018 / 13:44
3
answers

How to create an accumulator

I have some classes that I want to display the number of approved students. What I've Done nota= a  if nota >= 60 and nota < 100:          else: Exit passed 20 disapproved 50, but I have seventy students. How to do?     
asked by 10.07.2018 / 12:06
1
answer

How to set the parameters in the parameters that should be sent?

Gross example of what I want (which does not work): # -*- coding: utf-8 -*- def a(int(b), str(c)): # Isso não funciona, mas quero algo assim. print('Isso é um Numero: %i' %b) print('Isso eh uma String: %s' %c) a(10, 'Texto') # -*-...
asked by 09.07.2018 / 04:33
1
answer

Formatting two decimal places using list (Python)

I have a question about formatting decimal digits using two boxes, for example "2.00", I did this exercise but I have a problem that I can not solve as I do not know if there is any way to do it. Format product values that are within a list....
asked by 26.01.2018 / 17:33
2
answers

How to make link to file download in html?

I'm using the tag: <a href:"{{ arquivo.caminho }}" download>link</a> With the download attribute to download links from my local network files (tiff images), however, the downloaded file is a .tiff file containing the html of my...
asked by 30.01.2018 / 19:56
1
answer

Python Dictionary 3

Hello, could anyone help me understand why 8 is the correct answer? Thank you in advance.     
asked by 26.12.2017 / 14:24
2
answers

How to call a method of views in html?

I created the following method in the views.py file: def home(request): name = 'Jacinto' args = {'myName' : name} return render(request, 'accounts/home.html', args) I want to now call this function that redirects me to the home.htm...
asked by 11.01.2018 / 16:29
1
answer

Doubt the use of If, While or for

I'm new to python programming. I have a vector with values ranging from 0 to 200 randomly and I want to do a routine to delete (remove) values that are below 30 and above 160, and create a new vector with those values.     
asked by 30.04.2018 / 21:39