Questions tagged as 'python-3.x'

1
answer

Storing ManyToMany fields in a forms.ModelForm form

I am building a form based on some models in one of which I have attributes with ManyToMany relationships to others. The situation is as follows: Model CorporalSegment class CorporalSegment(models.Model): SEGMENTO_HOMBRO = 'Hombr...
asked by 19.07.2016 / 04:47
1
answer

How can I store a data from a column of a sqlite database in a variable using Python?

I have a problem I am trying to get a value from a database in sqlite3 using python: import sqlite3 #Conexion a la base de datos con = sqlite3.connect("basededatos.db") cursor = con.cursor() #Comprobar conexion a base de datos cursor.execute...
asked by 23.08.2018 / 12:54
0
answers

Random map with Python3 pygame module

I'm creating a Roguelike style game with the pygame module. The problem I have is that I do not know how to continue the code, the maps are drawn in a txt file with characters (# = door,. = Empty, 1 = wall and p = character) I only managed to pu...
asked by 30.09.2018 / 00:15
0
answers

Error in pyHook KeyboardSwitch ()

I'm experimenting with a keylogger: import pyHook, pythoncom def eventoTeclado(event): data_key = 'WindowName:'+str(event.WindowName)+ '; Ascii:'+ str(event.Ascii)+" "+ chr(event.Ascii)+ '; Key:'+ str(event.Key)+ '; KeyID:'+ str(event...
asked by 13.10.2018 / 04:55
1
answer

Multiple timer running at the same time from the same function in different threads

I want to use a function to launch a timer with different frequencies for each of the threads that I open. I do not know if this is possible. Could you help me out? import threading import logging logger = logging.getLogger(__name__) lock = t...
asked by 15.06.2018 / 18:56
0
answers

gi.repository Gst problems

I am writing a simple script to play an audio file with the Gst (gstreamer) library of PyGobject, when executing the script the following error is displayed:    (python3: 31506): GStreamer-CRITICAL **: 00: 55: 27.705: Trying to   dispose elem...
asked by 29.10.2018 / 06:01
1
answer

Help with Python 3 UnicodeDecodeError when receiving bytes

I have to send the output of an "ipconfig" command using a socket with the check_output method of the subprocess module. This process used to be easy in the Python version 2.7 but in Python 3 everything is more complicated and it shows me a Unic...
asked by 27.06.2018 / 00:12
1
answer

Iterate repeatedly on file parsed using csv.reader

I am trying to do a search filter of a tsv file, where the user enters the filters to visualize the data he wants to iterate over the file. The code that I am using is the following: import csv with open("results.tsv") as tsvF: reader = c...
asked by 04.04.2018 / 19:37
1
answer

Iterate repeatedly on file parsed using csv.reader

I am trying to do a search filter of a tsv file, where the user enters the filters to visualize the data he wants to iterate over the file. The code that I am using is the following: import csv with open("results.tsv") as tsvF: reader = c...
asked by 04.04.2018 / 19:37
1
answer

Python3. NameError: name '' is not defined

I am using PyQt5 with Python 3 and I am trying to import redis, but when making the connection it gives me this error named 'connection' is not defined the code I have it like this: Logica: import redis Class Logica(): conexion...
asked by 20.04.2018 / 16:36