Questions tagged as 'python'

2
answers

Failed to query in firebird with fdb in python 3

I try to make a query in a database using Firebird, this is my code: import fdb import os ruta = 'localhost:C:/Users/Beto/Documents/Proyectos python/Ruby/sama.fdb' try: con = fdb.connect( dsn = ruta, user = 'sysdba', password...
asked by 09.05.2016 / 05:36
1
answer

Configure several versions of Python in Sublime Text 2 with REPL

I have two versions of Python and I have REPL in Sublime Text 2 but I only get one version of Python. How can I do to be able to choose between both versions?     
asked by 10.03.2016 / 08:44
1
answer

Problems working with kivy in Python 2.7

I have Python 2.7 and I have installed kivy. It has to be installed correctly because when I import it from the Python console it does not give me an error. But if I keep entering code I have problems. I am new to this and I do not know what...
asked by 08.03.2016 / 14:04
1
answer

Print data in a printer from python in windows

I'm doing some research on how to print data to a local printer from Python on Windows. If you have the document and its route, a simple way that I found was this: import os os.startfile("C:/Users/Jdash/Desktop/TestFile.txt", "print") Ho...
asked by 14.02.2016 / 17:58
1
answer

Is it possible to make my own API from a site that does not have an API with Python?

If a web page / service does not offer an API for my programs to interact with the site, what libraries can I use to make my own API from the site I want to use Pyhton or some other tool?     
asked by 28.02.2016 / 08:51
1
answer

Update django record in short period of time (ms)?

Greetings I hope you can help me with this topic I would really appreciate it! The situation is as follows: In my project django I have an endpoint in which the client connects makes a request to update a record in the db. The endpo...
asked by 13.09.2016 / 16:42
1
answer

Generate a dictionary from the models

I am working in Django and I have 5 models: Company Agent Sensore Template Data There are several relationships as fixed in code. What I want is to generate a dictionary like this example in the Views: { "Empresa": { "Agen...
asked by 01.01.2019 / 18:50
1
answer

How to play videos with the Python IO library?

I would like to play a video that I get from an ftp server, at this moment the file is being saved on the server but I do not want it to be saved but to be played immediately. They told me that with the library io it can be done but I would l...
asked by 04.04.2017 / 23:11
1
answer

How to filter in a serializer?

Hello, good morning, I want to obtain in a webservice / Api all the appraisals depending on the agency, I'll leave them as I have until now These are my models class Agencia(models.Model): nombre = models.CharField(max_length=50,) razon_soc...
asked by 06.04.2016 / 19:56
1
answer

Python: it does not do what I expect it to do

I am learning to program in Python, I am using as a guide "Learn to think like a programmer in Python 2x", and I use Python 3.6. I am in the part of POO classes, methods, attributes, etc; in which he uses as an example a Card Game (the cute o...
asked by 29.12.2018 / 01:23