Questions tagged as 'python'

3
answers

How to start a range from 1

I wish that in the    input ("Put the student's note" + str (notes) + ":") The computer asks " Put student grade 1: " and not starting from 0, how to do this with the range function? Code below. Alunos = int((input("Digite quantos al...
asked by 13.05.2017 / 05:47
2
answers

Class return key and value of my attributes

I have the following class: class RegC100: def __init__(self,linha): def convFloat(valor): if (valor != ''): valor = float(valor.replace(",", ".")) return valor else:...
asked by 24.01.2017 / 13:32
0
answers

Django session timer countdown

I have this in my login screen: SESSION_COOKIE_AGE = 1200 # 20 minutos and would like to show the remaining time in my template. Does anyone know a good middleware or package for Django that adds a missing timer to logout. I did not fi...
asked by 13.01.2015 / 21:49
2
answers

square root "perfect" in python and identify the rest:

It's for python 3: What I'm trying to do is show the rest of a square root account that only accepts the largest integer possible in response. For example: import math x=math.sqrt(87) print(x) This code returns 9.327379053088816, I wan...
asked by 26.08.2017 / 09:32
1
answer

Obtain image from just one sector in a scanner (python)

Good afternoon! I need to develop a python application and I can not get the program to get an image of a sector of the scanner, only the whole area that the scanner can scan (approximately one A4 sheet). I'm still a beginner in language. My...
asked by 20.09.2015 / 22:48
3
answers

Doubt in my code is not printing correctly

question: Using the text file notas_estudantes.dat write a program that calculates the minimum and maximum grade of each student and print the name of each student along with its maximum and minimum mark. file: jose 10 15 20 30 40 pedro 23 16...
asked by 07.10.2018 / 03:56
2
answers

Error in "utf-8" in python 3

I'm having a problem with python 3 in the code: #!/usr/bin/env python #-*- coding: utf-8 -*- import urllib.request page = urllib.request.urlopen("http://beans-r-us.biz/prices.html") text = page.read().decode('utf8') print(text)' Give e...
asked by 06.11.2016 / 21:59
0
answers

Linux Script - Search, Copy, Paste and Change file values te texto [closed]

I have these 3 files: Access.txt : Large text file with records per row and columns separated by " ; ". < br> NewAcess.txt : List of new hits to add. NewUsers.txt : List of new users to add. Sample Files:...
asked by 08.04.2015 / 20:02
1
answer

Python command subprocess.check_output

I'm calling a program in Java via Python's subprocess.check_output command. It's not working. In this command I pass a file as a parameter. Is there something wrong with the command below? import subprocess def chamaProg(arquivo):...
asked by 06.05.2015 / 14:53
4
answers

How do I organize each position in my list in ascending order?

This is my code: a = [[3,2,1],[4,3,2],[5,4,3]] for i in range(0, len(a)): for j in range(0, len(a[i])): a[i].sort() print(a) The problem is that you are only organizing the first position. Could someone give me an orientation...
asked by 04.08.2018 / 04:15