Questions tagged as 'python-2.7'

0
answers

Open files through the relative directory

How do I read the relative file path that is in a directory other than the python file and then open that file? For example: For file1 in the project_name / files / file1.txt directory and the python code in the project_name / src directory...
asked by 17.09.2017 / 01:44
1
answer

Session not identified in some logins in django

I'm doing a maintenance on a Django app version 1.5 with DRF 2.3. This app has non-standard Django user authentication, and that works well. See a summary below: accounts / views.py class Autentica(TemplateView): template_name = 'checkuser....
asked by 30.08.2017 / 18:53
1
answer

Python2.7 with OpenCV 3.3.0 - VideoCapture problem

I'm running OpenCV 3.3.0. with Python 2.7 on a Windows 7 Professional x64 machine, and when I run the code below, it falls on the prints "Something went wrong" and "Finished ..." import cv2 capture = cv2.VideoCapture("video.mp4") #The video i...
asked by 08.09.2017 / 20:15
1
answer

Set CLASSPATH to be accessible in Apache

How can I make the environment variable CLASSPATH accessible by apache? I have a Django project that uses the python-weka-wrapper library that bridges Weka's Java implementation. Everything works perfectly on the Django devel...
asked by 08.09.2017 / 18:37
0
answers

How to stop a progressbar in Tkinter

I've always been developing in JS a little lost here in Python, if you can help me ... I wanted to leave the button close without an event until the progress bar is gone, and the progress bar on completion is "indeterminate" #Loading pa...
asked by 13.08.2017 / 22:34
0
answers

I need to access the sdados of this list and save in a txt file line by line

From matricula import Aluno class repasse_matricula(Aluno): def __init__(self): arq = open('Alunos Matriculados.txt', 'r') self.alunos_matriculados = [] for k in arq: if k == 1: nome = self....
asked by 08.08.2017 / 00:16
1
answer

Opening Shell script in Python

I'm automating tasks and I'm new to Python, so I'd like your help because I need to run a Shell script on another machine and this command I need to give inside a Python code. I thought about using something like: #!/usr/bin/python # -*-...
asked by 01.08.2017 / 07:37
0
answers

conversion from Unittest Python2 to Python3

I'm having some free time and I'm upgrading to Python3. I came across a problem in running the unittest, and I believe you can help me. Error: File "/home/brito/projetos/00-incolumepy/tests/generators_test.py", line 28 self.assert_([...
asked by 10.07.2017 / 14:09
0
answers

How can I trace a real-time spectrogram by reading data from an ADC like the "MCP3008" connected to the GPIO of Raspberry?

My idea is to read data from an ADC like the MCP3008 connected to the Rasperry GPIO, from the readings plotting a real-time graph of the signal processed by a FFT (fourrier rapid transform) or STFT (transformed short of fourrier) Example...
asked by 07.06.2017 / 19:43
1
answer

Random.getstate function Python

I need your help in the following situation: I have a loop that every random interaction is generated from 0 to 400. I need my function to return at what point in the loop the X number was generated. (For example, loop 4 generated the n...
asked by 03.03.2017 / 00:46