Questions tagged as 'python'

1
answer

Show form in a view based on Django classes

I have the impression that it must be something simple, but I can not do it with CBV's. I try to render a view that shows the content of a post, and at the same time, in the same view, show a form so that comments can be added to it. The first t...
asked by 06.07.2018 / 01:27
1
answer

Add resize event to a qwidget pyqt5

I have the following problem: I am designing a user interface for a program, however I did not use a main window since I did not find a way to reduce the size of the qstatusbar So I'm doing it on a qwidget, the problem is that by removing...
asked by 30.06.2018 / 18:20
1
answer

Replace values in a CSV Python

I'm lost with something. I have a csv file that I import with Pandas to be able to convert it into an Numpy array, and I have the following function to replace values in the original CSV file: # Cargamos el archivo en la variable data, com...
asked by 30.06.2018 / 18:45
1
answer

pyqt5 does not center the window

Good afternoon I'm trying to center my app with the following code: from PyQt5.QtWidgets import QMainWindow,QApplication,QDialog, QDesktopWidget from PyQt5 import uic, QtCore, QtWidgets from PyQt5.QtGui import * from PyQt5.QtCore import * fro...
asked by 01.07.2018 / 23:32
1
answer

Send and receive messages in c and python (client and server)

I need to know how I can send and receive messages from these two different languages. I would thank that very much. (I'm new to this): $ Server python (Centos): import socket import threading def conexiones(socket_cliente): peticion...
asked by 12.06.2018 / 05:36
0
answers

I miss an "IndentationError: expected an indented block" [closed]

I jump one:    "IndentationError: expected an indented block" def impar(x) : if x % 2 == 1: print("%d es impar" % x) rdd.foreach(impar)     
asked by 26.06.2018 / 16:55
2
answers

Vocal Counter

I'm going crazy trying to do the vowel counter, the slogan as it says:    Enter 10 sentences. Count and display the number of vowels only of the phrases that contain a period. They gave us some kind of instructions to do it but I do not u...
asked by 08.06.2018 / 23:41
1
answer

Problem installing flask-mysqldb on linux 16.04

I was trying to install the flask-mysqldb on my Linux 16.04 device but I found a problem, even with a virtual environment: _mysql.c: 32: 20: error fatal: Python.h: No existe ese archivo o directorio . (myFlaskAppenv) mike@mike-thinks:~/P...
asked by 02.06.2018 / 14:48
1
answer

Play complete audio file with python-vlc

I'm making a music player in Python and I'm using libvlc using python-vlc , but I do not know how to play an audio until it is finished, because if I remove the function time.sleep does not play the audio. This is my cod...
asked by 22.06.2018 / 02:01
1
answer

Run a script in Python with Crontab

I need to execute a script that is programmed in Python so that it runs every so often, specifically every 3 minutes. I am using crontab and the file that I modified was the following: crontab -e Within that file the content that you pla...
asked by 20.06.2018 / 18:46