Questions tagged as 'python'

1
answer

Fit a background image in python

I have a problem I want to adjust the background image to cover the entire interface, but I move the size and sometimes if you show it to me and other times you can help me in this detail please from tkinter import * from tkinter import Tk...
asked by 03.04.2018 / 03:31
1
answer

Redirect Django with paramentros

I'm running a payment gateway in Django and I'm trying to split the procedure into two views, one makes the call and gets the answer and the second processes the response. Right now my code is something like this: def comprar(self): ......
asked by 02.04.2018 / 16:34
1
answer

Get list of integers using stdin.readline ()

I use this the following entry to enter a list of numbers, for example this list: 1 2 3 4 5 6 a=stdin.readline().strip().split() If I give you print(a) it shows me ['1','2','3','4','5','6'] , my question is if you can modify th...
asked by 31.01.2018 / 07:06
2
answers

AttributeError: 'NoneType' object has no attribute 'group'

Can someone help me? The last row of the code gives me an error. os.chdir("./envolventes") diractual = os.getcwd() ficheros = os.listdir(diractual) lista_sin_D = [ x for x in ficheros if "D" not in x ] import re lista_A_menor45 = [ x fo...
asked by 23.01.2018 / 19:37
1
answer

Fill comboBox with result of lineEdit

I am making my first plugin for Qgis 3 with Plugin Builder, and I have the following form On the other hand I have a table in sqlServer that contains the following values. Nombre idLote Situacion 1 Contexto 1 Detalle...
asked by 04.08.2018 / 12:53
1
answer

read several lines in python 3

Nesesito read several lines in python 3, I have this without pressing ENTER: Love Rome Hello Hello Occasionally Staging bear dog Possessionary Possession Colombia Locombia Mommy Mommy and I need python to read me all the lines and print me in a...
asked by 20.01.2018 / 20:27
1
answer

Error writing to file, you can not concatenate str a bytes

I've done a simple tcp server in Python and what I want to do is save the client's messages in a text file. What happens is that when I try it, it means that you can not concatenate bytes to string. Would they know how to do it? This is th...
asked by 02.02.2018 / 17:45
1
answer

How to save the fk of a model in django?

I have a model called a device, this creates the folio and the name and additional I want to store the id of the user that is logged. This is my class: class RegistroDispositivo(CreateView): model = Device template_name = 'registroDisp...
asked by 03.02.2018 / 00:46
2
answers

Problem with a Choice [Django - Pyhon]

Good morning! I have a modeo which has a field of type text in which is a "choice". ANUNCIADA = 'A' AMARRADA = 'M' TERMINADA = 'T' ANULADA = 'N' LIST_ESTADOS_ANUNCIOS = ( (ANUNCIADA, 'Anunciada'), (AMARRADA, 'Amarrada'), (TERMINADA, 'Termi...
asked by 02.02.2018 / 19:52
1
answer

Indent problem - python

Sorry for the silly average consultation. How do I solve the indentation problem on line 54? I know it's a spacing problem, but I can not get that error out. link import os from threading import Timer from os.path import isfile, join, exists...
asked by 10.01.2018 / 22:24