Questions tagged as 'python'

1
answer

Work JSON data with Django

When the convertir() method is executed, all data in the table is converted to JSON , but I need to get the data for each row instead of the entire table. How can I do that? Javascript Code: function convertir() { var table =...
asked by 13.05.2017 / 15:42
1
answer

Problem when making inquiries in psycopg2

good day I'm working on a project where I need to consult different databases and for that I use the psycopg2 extension of python, however at the time of making a query it only shows me the first data of it , despite the fact that there is a lot...
asked by 03.05.2017 / 22:37
1
answer

Error saving form

url.py url(r'^paciente/(?P<pk>\d+)/', PatientDetails.as_view(), name='patient_details'), view.py def add_deworming(request, pk): if request.method == 'POST': form = DewormingForm(request.POST, patient=Patient.objects.get(pk...
asked by 05.05.2017 / 23:09
1
answer

Help in Python files

I have this code: import sys import time import fileinput from os import system from os.path import isfile class Student: def fill(self): self.id = input("ID: ") self.name = input("Nombre: ") self.age = int(input("Edad: "))...
asked by 18.04.2017 / 00:02
1
answer

Data comparison error in database

Trying logearme with username and password from your own database, does not make the correct comparison in if and skips to condition else . Code import mysql.connector import sys from Tkinter import * dato={ "user":"ro...
asked by 17.04.2017 / 03:30
1
answer

create a server capable of serving multiple clients in python 3.6

At the moment my server can only serve a client with whom I can send text messages, I would like to connect with another client and do the same #cliente import socket host = "127.0.0.1" port = 6666 sock = socket.socket() sock.connect((host,...
asked by 14.04.2017 / 23:18
1
answer

Kivy Launcher: I can not create the / storage / emulated / 0 / kivy directory

To launch an application in Kivy Launcher, it puts me: No projects are available to launch. Please place a project in / storage / emulated / 0 / kivy and restart this application. Press the back button to exit Then I search for that dire...
asked by 14.04.2017 / 11:45
1
answer

Get the HSV value of a pixel

I am using Python and OpenCV and my intention is to take the HSV value of a pixel: Original image: HSV Image ( hsv ): hsv = cv2.cvtColor(image, cv2.COLOR_BGR2HSV) print(hsv[47,115]) >> [ 98 245 202] The value that re...
asked by 11.04.2017 / 16:52
1
answer

Show date filter data in Django

What I want is to make a data filter and show values according to dates. To make evaluations, monthly, quarterly and so on. To explain myself better, I leave my view.py and my form.py form.py class FiltroFechas(forms.ModelForm):...
asked by 10.04.2017 / 22:03
1
answer

method of. it does not work the way I thought

I want to create a deck of cards that gets the first card after it shuffles from random import shuffle def doing_deck(): value = ['a','2','3','4','5','6','7','8','9','t','j','q','k'] suits = ['H','D','S','C',] cards = [] fo...
asked by 12.04.2017 / 20:55