Questions tagged as 'python'

1
answer

Select within for

Next, my question is more about logic anyway .. I have a python script in which I use psycopg2 to perform searches in the database. But I need to do this within a for. I have full notion that doing a search within a for can affect and much in c...
asked by 12.12.2017 / 12:32
1
answer

Web application for script monitoring

What is the best way to monitor script execution? I have a script.py that needs to be running "infinitely", and I'd like to know if it's running or not. I would like a web application to do this monitoring, and if it closes, I can run it through...
asked by 20.12.2017 / 19:53
1
answer

Problem with python executable generated by pyinstaller

I made simple python software with graphical interface. I did the build with pyinstaller and when I try to open the generated executable, the windows command prompt is also opened every time. I have already been instructed to change the file ext...
asked by 03.01.2018 / 14:20
1
answer

Matplotlib python normalize y-axis

I'm trying to normalize the y-axis of this plot, when I say normalize and leave on the same scale import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec import numpy as np from matplotlib.legend_handler import HandlerLine2D...
asked by 04.01.2018 / 01:57
2
answers

Recursion in Python 3

I'm having trouble organizing a recursive sum formula in Python. I need to calculate: My code: def seq1(n): if n == 1: return n return seq1(n-1)+(-1**(n+1)/n) I get the same error for almost every change: Recursio...
asked by 02.01.2018 / 22:38
1
answer

Django 2.0 - Urls Amigavel

I'm studying Django 2.0.2, and I'm having trouble with friendly URL along with SlugField in the models.py class, but I can not set def get_absolute_url(self): correctly. I can access the URL directly. It is now necessary to define the fun...
asked by 20.02.2018 / 23:09
1
answer

xlrd open files in xls format?

I'm sorry for my ignorance on the subject, but I'm developing a Python script that reads Excel files to get certain information in those, and for this I'm using xlrd, I wanted to know if xlrd is able to read xls files too, which is an older Exce...
asked by 17.12.2017 / 18:44
1
answer

Get declared variable in the function outside the decorator

I tried with the module inspect but could not get the result. The concept is: "scan" a file through a decorator . Steps Capture variable file before function read_file will be called "Scan" file Return...
asked by 17.12.2017 / 15:17
2
answers

Separate data from a txt file

I have a relatively large data file, which I removed from a point marking machine, however it comes as follows: 00003000527005792012635570932000219305130720170713 00003000527005792012635570932000219305130720170713 I would like to separate t...
asked by 12.01.2018 / 13:31
1
answer

Sorting and sequencing data from a file

I've developed a program that stores a list of ids, so Butforthedesiredpurposes,thedatashouldtakethesequentialform,sothatthefirstpairofidsissomethinglike:"889926212541448192" becomes 1 and "889919950248448000" becomes 2. That is, the file to...
asked by 23.11.2017 / 19:46