Questions tagged as 'python'

1
answer

Data overlapping the x-axis of the graph

I need to put a series of dates (timestamp) that are stored in a bd on the x-axis of a chart, the problem is that the dates overlap and an efficient analysis is impossible. Follow the code: # -*- coding: utf-8 -*- import MySQLdb as mdb import...
asked by 06.06.2017 / 21:48
4
answers

Error trying to write accents in files with Python

I was trying to make a program in Python that could make changes to another .py file so I could change its code automatically. I was doing the following test in Shell before writing the program itself: >>> import os >>> file...
asked by 13.04.2017 / 20:57
1
answer

How to get text, in CSS element receiving 2 class

I need to collect text from an angled system, where the element receives 2 CSS classes <div class="title ng-scope">80</div> I tested several ways to capture the text, but it does not return (the commented lines shows the attempt...
asked by 14.04.2017 / 23:13
1
answer

Python returns "dead" when trying to read json 240mb [closed]

The problem occurs on a final CentOS server version 6.8. The same script with another smaller file works perfectly. Test done in Ubuntu 16.04 the process occurs successfully. Any solution? Follow the code below. gist code     
asked by 20.04.2017 / 15:16
1
answer

Problem using lists of vowels and even numbers

The exercise is as follows:    Make a program where the user types a letter and a number   all. If the letter is a vowel and the number is even, or the letter is   consonant and the odd number, show "BAZINGA!". Otherwise, show   "SHAZAM!"....
asked by 14.05.2017 / 05:25
1
answer

Refresh console line [duplicate]

I have a loop in python, and I would like to report the value of a variable every time it is updated, but I do not want to dirty the console giving print every time < the console . Is there a way for me to get this result? print("Execut...
asked by 09.06.2017 / 22:47
1
answer

Check if a file exists within a specific directory

I have several files inside a directory called imagex , about 5,000 images. A simple example of a file: file_path = "C:/imagex/jonsnow.png" How do I efficiently check if there is a specific image within this directory?     
asked by 23.03.2017 / 16:33
1
answer

why does the loop while True access the if and the else in sequence to each complete loop in that code?

#! /usr/bin/python3 valor = int(input("Digite o valor a pagar: ")) cedulas = 0 atual = 50 apagar = valor while True: if atual <= apagar: apagar = apagar - atual cedulas += 1 else: print("%d cedula(s) de R$%d"...
asked by 28.03.2017 / 17:35
1
answer

how to give two splits in one txt [closed]

I want to give two splits one to delete lines of txt and another to delete the tab of it in txt has name: surname ex Rafael: Lima the separator and ":" how can I do this?     
asked by 26.04.2017 / 20:12
1
answer

How to format input with float and range in Python 2?

I need to make an average calculator (student notes) where the entries have a decimal place and are in the range [0, 10]. The outputs must have five decimal places and so far, with what I have been able to describe, the code is: a = float("%.1...
asked by 26.04.2017 / 16:53