Questions tagged as 'python'

1
answer

Saves browser state or cookies using selenium

I am doing tests using whatsapp web, so every time I run selenium, I read the qr code and start the tests, and I have to do this every time, I would like to know if there is a way to save the browser state, save session, some way to start the br...
asked by 28.09.2017 / 22:59
1
answer

TypeError: a float is required

Good evening. I have the following code in Python which, when calculating the variable h , appears the mentioned error: x=[] y=[] erro=[] h=[] x=0.1 y=0.1 for i in range (40): x=x**2-0.391*x y=y*(y-0.391) import math erro...
asked by 29.09.2017 / 01:58
1
answer

How to adjust the focus using Opencv and Python?

Hello. I am building a robot that moves through acquired images. However, when it is in motion, it is lost because the image is out of focus. I ask if there is any configuration inside the OpenCV that calibrates this function. Thank you.     
asked by 09.10.2017 / 20:17
1
answer

IndexError: index 3 is out of bounds for axis 0 with size 3

I have this code in Python, but the following error appears:    IndexError: index 3 is out of bounds for axis 0 with size 3 Code: import numpy as np import math A=11 T=(math.pi)/60 tf=15000 u=[] x=[] x=2*(np.ones((3,1))) for i in rang...
asked by 09.10.2017 / 20:03
0
answers

Interpreting JPG in Python

I would like to know how to interpret a JPG image with Python? I want to manipulate it but before I need to open the file and interpret it, I would also like to know if there is a more compact form of file than the JPG.     
asked by 30.09.2017 / 04:55
0
answers

Module requests are imported into IDLE, but not into Thonny (the IDE I use)

I installed the module requests through Terminal with sudo pip3 install requests (I'm using Mac) and I was able to import it through the interactive shell without problems in IDLE. But when I try to import through Thonny's interact...
asked by 07.10.2017 / 00:46
0
answers

Naming file with sql query data

Hello, I need to name each file created by the script with a single column data from my database. Here is the code: for index, source in zip(list(range(0, len(self.sources))), self.sources): if self.jsonfile is not None and sel...
asked by 20.09.2017 / 19:49
0
answers

Sending email taking data FK Django

I have group and profile, in my register the person chooses the group and this group has the responsavel_id, I want to pick up and send a confirmation email to the person in charge of that group that the user chose models.py class Grupo(mod...
asked by 20.09.2017 / 14:47
1
answer

I can not open another Form of PyQt5

I can not get the other window of my file to appear. Code: # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'testando.ui' # # Created by: PyQt5 UI code generator 5.9 # # WARNING! All changes made in this file wi...
asked by 17.09.2017 / 19:32
1
answer

I'm trying to make my chart start from position 0 using hist ()

Using USAGE_PLOT is easy to do but I want to do and learn how to use hist. the same way it is in the image below in which it was used usage_plot(trip_data, 'duration', ['duration < 60'], boundary = 0, bin_width = 5) ButI'mtryingsever...
asked by 18.09.2017 / 00:24