Questions tagged as 'python'

1
answer

Menu creation using Web2Py?

I'm having trouble creating menu on my website using the default Web2py template, any tips and examples? I tried following example link Just does not appear on the main page.     
asked by 07.02.2014 / 16:39
1
answer

Python - Compare Lists, using conditions to determine Start and End of Search

Introduction : Program has 1 Lists and 1 Set : List = Data Entry ; Set: Comparison Data lista_entrada = ['BBB','AAA','CCC','DDD','EEE'] print() for item in lista_entrada: print("item") lista_bd = {'AAA','BBB','CCC','DDD...
asked by 12.11.2018 / 02:09
1
answer

Save float array to a txt file

After saving array in txt I want to be able to work with each of the values doing all the mathematical manipulations, but the way I'm saving I'm not getting it. Can anyone help me. import numpy as np xold = np.random.rand() N = 3000 x0 = np....
asked by 11.11.2018 / 15:34
1
answer

output function giving error syntax

lista1 = [1,2,3,1,1] lista2 = [2,2,3,1,3] res = list(input("Digite seus inteiros")) def exibiçao(lista1,lista2,res): print("{} {} {} {} {}".format(lista1[4],lista1[3],lista1[2],lista1[1],lista1[0] )) print("{} {} {} {} {}".format(lista2[4],lista...
asked by 02.11.2018 / 14:33
2
answers

ELIF using not in, within a FOR

I would like to know if there is any way to refine the ELIF within a FOR, so that it does not enter in the FOR whenever the date does not exist, but rather if that date does not exist. Here's the problem: For each meeting date {%for u in...
asked by 08.11.2018 / 00:37
1
answer

How do I show an image according to given Number being this number is by random in python?

import numpy as np import matplotlib.pyplot as plt from PIL import Image import cv2 def showfig(image, ucmap): imgplot=plt.imshow(image, ucmap) img0 = cv2.imread("zero.jpg",0) img1 = cv2.imread("um.jpg",0) from random import randint #gera...
asked by 30.10.2018 / 22:32
1
answer

How to make a class interfere in another with python [closed]

I'm trying to make a switch in kivy style, when one is true, the other is false, but when I change a variable in the first class, it is not changed in the second, and remains with the original value. Explicating: c = 'NADA' class A():...
asked by 22.11.2018 / 00:56
1
answer

Pandas iterrows, how to do the second looping using the index

for index, row in candles.iterrows(): if (row['Twintower'] == 1): I would like to do a second looping from the moment he finds this condition, ie from this index down, or row down, I tried several options TypeError...
asked by 22.12.2018 / 22:55
2
answers

How to make a text generator according to the possibilities I put in it

I've been looking for a few days about how to combine a random text according to the possibilities that I put inside the parentheses. Example: (Hello, Hi, Good afternoon) How are you? (Your day is fine? How long !!!) My question is: how do I gen...
asked by 26.12.2018 / 11:54
1
answer

Insert only if date is not duplicate - Python

Good afternoon, guys! Today I am making an insert that does not check if such a record has already been inserted into the database. Through the variables: name, date and number is a missing insert in the table: nome = message.who_name numero =...
asked by 25.12.2018 / 17:52