Questions tagged as 'python'

1
answer

Python: How to execute a function on an X number of files (.XML)?

I need to run a Python function on a large number of .XML files. I need the parsing function to run on all the files that end in .XML. This is a fragment of the code to parse the .XML file: import os import xml.etree.ElementTree as ET d...
asked by 02.06.2017 / 13:12
1
answer

Problem with django-bootstrap3

I have installed Django 1.11 and django-bootstrap3 in version 8.2.3 by pip. I'm making a simple application that carries a form. Reviewing the online documentation I saw that the configuration of Bootstrap 3 must be added in the settings.py as f...
asked by 25.05.2017 / 18:53
0
answers

How to make a query with several pipes with python on a MongoDB database [Errno 111]?

I want to make a query about a mongoDB database with a python script that will allow me to modify the query about the schedule. However I am not able to visualize the result: #!/usr/bin/python import pymongo import datetime import pprint fro...
asked by 23.05.2017 / 09:23
0
answers

How to insert an image in Python?

How do I solve this error?    "could not open" 3.gif ": no such file or directory" I created a folder in which I saved the work and the image but followed the error. The code I have to implement the image: import numpy as np import r...
asked by 27.05.2017 / 00:23
1
answer

How to connect to PostrGreSQL with a python script?

I want to connect to a database with a Python script but I have a problem doing it. I use Psycopg but it returns an exception. Here is the script: #!/usr/bin/python # # Pequeno script para connectarme a PostgreSQL con Pyscopg # import psycopg...
asked by 18.05.2017 / 09:58
0
answers

How to use the admin Widget to add items

I am a beginner in this, the query is how I can add in my form the image of "Edit" and "Add" in a choice field and I opened in a pop-up the form of that model to add it. As Django admin does but I would like to do it from my form. Thank you....
asked by 23.05.2017 / 18:14
0
answers

how to show only data True in a foreign key of python

models.py: class Article(models.Model): ... user_create = models.ForeignKey(User, null=True, related_name = 'user_create') upd.html: ... <label class="control-label col-md-2">Creador</label> <div class="col-md-7">...
asked by 09.06.2017 / 16:09
1
answer

GLib-GIO-Message running python script

When running a python script I get the following error: GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications. I have no idea what it is and how to fix it. Note: The pr...
asked by 08.06.2017 / 18:37
0
answers

The program closes automatically after 2h python

I have a program in python that allows me to read and store values every 10 seconds (to collect data). The program is simple and works well but the problem is that it only works 2h and 24 minutes. Then without knowing why it closes and yo...
asked by 15.05.2017 / 16:31
0
answers

Django with PyInstaller

Dear, I am trying to compile Django .exe with PyInstaller. The installation of Django and PyInstaller is fine, when I compile it also does it well: $ pyinstaller --name=mysite mysite/manage.py But the problem is when I want to run the .exe...
asked by 13.05.2017 / 12:33