Questions tagged as 'python'

1
answer

Add value 5 at the end of the list / tuple

lista_da_tupla_a=(["0", "33", "40"], ["8", "30","9"], ["7", "0", "0"]) lista_da_tupla_a = list lista_da_tupla_a[2] = "5" print(lista_da_tupla_a) Desired output: (["0", "33","5"], ["8","30",5], ["7","0","5"])     
asked by 21.07.2018 / 00:33
1
answer

How to make a request and search for a string

I would like to know how to give a request and look for a string, for example: * www.site.com / index.php? id = '(SQL Error) (look for or error)
asked by 08.08.2018 / 23:01
1
answer

Python - Replace x lines above and below searched text

Good, I needed to do something that in a document filled out for example like: linha1 bla bla linha2 bla bla linha3 bla bla linha4 bla bla linha5 bla bla linha6 bla blax linha7 bla bla linha8 bla bla linha9 bla bla When doing a search fo...
asked by 19.07.2018 / 16:37
0
answers

Sadia real-time Python script in html with nodejs and python-shell

I'm trying to make a server that asks the user for a data, uses it as an argument in a python script, and shows the real-time output for the user in the browser. I'm using python-shell to call the python script and pass the arguments. Until now...
asked by 19.07.2018 / 19:36
0
answers

Limitation on the number of characters Tweepy

I'm using Tweepy to fetch some tweets and I've noticed that it's stopping processing the phrase when it reaches a certain number of characters. Why does this happen and how do I get the whole sentence? for tweet in tweepy.Cursor(api.search,...
asked by 19.07.2018 / 17:58
2
answers

Checking of Accounts Python Hangman Game

I'm finalizing the hangman game in Python. But I have a problem with the final verification when the player hits the word, I can not create a check to validate if the player has hit the word, could they help me? from random import randint def...
asked by 19.07.2018 / 18:56
0
answers

Graphic error and simple list

import matplotlib.pyplot as plt x=[] y=[] z=[] dados=open('dados1.txt','r') for line in dados: line=line.strip() X,Y,Z=line.split() x.append(X) y.append(Y) z.append(Z) dados.close() plt.plot(x,y,'o') plt.plot(x,z,'o') plt.show...
asked by 04.08.2018 / 21:21
1
answer

Set a css class and render the form in django

I created the following class: from django import forms class FormDefault(forms.Form): def __init__(self, *args, **kwargs): super(FormDefault, self).__init__(*args, **kwargs) for field_name, field in self.fields.items():...
asked by 04.08.2018 / 04:59
1
answer

Django datetimefield as text

I am creating an application in django where I will have a form for creating a query schedule, my model looks like this: class Agenda(models.Model): """Criação da agenda de consultas da Clinica""" data_consulta = models.DateTimeField() pacient...
asked by 18.07.2018 / 16:49
1
answer

How do I instantiate a class using variables coming from a function return in Python 3?

Hello, I would like to be able to instantiate the class Sala below using as arguments the return of the choose_sala() function: The ideal would be to call on the return of the function the initialization of class Sala , but I...
asked by 19.07.2018 / 21:00