Questions tagged as 'python'

1
answer

I can not run code after the loop is [closed]

I'm using selenium as a crawler on a website. I have no experience with python. Here I create a dataframe with the data of a .csv df = pd.DataFrame.from_csv( 'tabela_etickets_copa3.csv', columns = header ) I open the b...
asked by 13.05.2015 / 20:27
3
answers

Change the first character of a string by the last character in python

I have the following function: def troca(s): letra1 = s[0] letra2 = s[-1] s = s.replace(s[0], letra2) s = s.replace(s[-1], letra1) return s troca ('bar') As you can see, I provide as an argument to my function troca...
asked by 31.03.2015 / 22:14
1
answer

Read merged rows and columns in excel, using python

I'm having trouble reading information from a spreadsheet that has merged rows and columns. I tried using merged_cell to get the value, but I do not understand how it works. Can anyone help me? Using the script below, I can get the values, e...
asked by 21.08.2014 / 21:15
3
answers

The operator module invokes special methods of objects

The biblioteca padrão do Python has the module operator , studying the same I noticed some of its functions have say "aliases" , for example: operator.setitem(a, b, c) operator.__setitem__(a, b, c) Set the value of a at inde...
asked by 29.10.2018 / 19:12
1
answer

Question: how to use python scripts for web?

I want to make a web application that will read colors in RGB of logos and create suggestions of color scales for websites. The algorithm will be in python using OpenCV. The client uploads the image > the image is read by the > the s...
asked by 07.09.2017 / 04:50
1
answer

Remove eye glow from image

Well, I'm trying to apply canny edge to the image because the brightness that is contained in the pupil impairs the result obtained because to have an edge with cv2.Canny() or feature.canny() needs that there is a continuity of it....
asked by 28.11.2018 / 19:49
1
answer

Losing image quality when resizing in pygame

I have some card images in size 140x190 and I'm using the pygame.trnasform.scale method to resize to 105x143 which is a proportional value. But it is losing quality, whereas the images of verses that are basically a background color and a...
asked by 28.10.2017 / 16:06
2
answers

Change border color and size Tkinter Menu

Can anyone help me with this question?     
asked by 13.10.2016 / 13:36
1
answer

How to send email with body and attachment using smtplib and email in python?

When I send a simple email in Python using only the smtplib library, I can type in the email body through the "message" argument of the script function: def enviaremail(usuario,senha,mensagem,listadestinatarios): from smtplib import SMTP...
asked by 17.01.2017 / 18:12
1
answer

What is wrong with this procedure when saving a form?

I have a registration form and I'm trying to save information on it. When trying to register, it returns a form error saying that the email already exists (even registering different types of e-mail). That is, it is saving before the checks i...
asked by 16.09.2016 / 19:08