Questions tagged as 'python'

1
answer

multiple commands with python subprocess

I'm developing a system (college work) that consists of a website for the use of a particular board. The problem is that to run the code on the card, I need to execute a lot of commands. Currently my code looks like this: def run(): com...
asked by 04.07.2018 / 20:46
3
answers

How do I in python to at the end of the code, it go to the beginning again

How do I in python to end the code, does it go to the start again and repeat once every 3600 seconds? My code: * fb = Facebook ( "meu-token" ) fb.testing = False try: start_time = time.time() markov.collecttext("./markov")...
asked by 14.10.2018 / 12:59
1
answer

Convolution 1D Keras

In my code, I have an array (820,53). I'm trying to do a 1D convolution but I always get the following error: Error when checking input: expected conv1d_1_input to have 3 dimensions, but got array with shape (820, 53). How can I solve the proble...
asked by 13.10.2018 / 15:33
1
answer

Error in python's print

Hello, I have a small problem, I think it's simple and I'll get help here. I have a code that gets a name, check if it's 'elvis' , if it's printa 'welcome' strong>. The problem is that when I hit the first name it printa the 'welcome' , but...
asked by 06.08.2018 / 00:16
1
answer

Django. Only change in bank via html

I've been developing in Django for a short time, I have a nice image on my site, when I click on it I would like to only change a field in the database without reloading or resending the page and stay in the same place. I have a question abo...
asked by 29.08.2018 / 14:40
1
answer

Function to create Column

Hello, I'm trying to create a column using a function, but it's giving an error, which should be silly to fix, and even then I could not, come on: import pandas as pd import numpy as np import matplotlib.pyplot as plt df = pd.read_csv("Pl...
asked by 22.08.2018 / 16:02
1
answer

How to remove unwanted characters from a list of strings?

I'm new to python and could not find an answer to my question. I get a list of texts from the database and transform it into a list of strings as below: textosPuros = df['texto'] # print(textosPuros) textoMinusculo = textosPuros.str.lower().s...
asked by 23.08.2018 / 16:24
2
answers

Python - Turn list of lists into a single list

How can I make a list of lists into a single list? I need to turn this: lista = [["Danilo","Gilson"],["Eduarda",["Costa","Otávio"]]] in this: lista = ["Danilo","Gilson","Eduarda","Costa","Otávio"]     
asked by 09.09.2018 / 22:25
1
answer

What are the impacts of Excessive Use of Try / Except?

I create a lot of programs with graphical interface and a lot of interaction with the user. I always exaggerate in try / except . What are the impacts of overuse?     
asked by 13.07.2018 / 15:41
1
answer

Button Bind in Tkinter.ttk TreeView in another Class

Problem How to create a button bind class in ttk.Treeview? Example Code When programming the main class, it defines the TreeView and then creates another class that defines bindings and events. It is not possible to create these binding...
asked by 16.07.2018 / 14:18