Questions tagged as 'python'

1
answer

Problem with reading files in python

I have some doubts regarding the issue of working with files in python since I am starting on this topic. Is that I have to make a program that reads lines of numbers separated by ":" from a file .txt in this case of comuni...
asked by 18.12.2017 / 17:49
1
answer

error in accepting unicode in django-python 2.7.1o

Good morning for everyone. The error that comes up is the following: At the moment I am trying to connect the database with django using mysql and the version of python 2.7.10 when using python manage.py and makemigrations in the end is as fo...
asked by 11.12.2017 / 15:05
1
answer

Python / Tweetpy - User Not Found

I am seeing how to extract data from Twitter with Python and Tweetpy, however when I put any user on the list, it does not find them. Am I wrong in the method ?. It is the following: for handle in handles_list: print ('Fetching @' + handle...
asked by 14.12.2017 / 14:00
2
answers

Create a list of random numbers in python

I'm trying to create a list of random numbers in python. I managed to create it but I just want to see the int () type and I see all types of float (), does anyone know what I can do? This is what I did: import random def listaAleatorios(n):...
asked by 11.12.2017 / 22:13
0
answers

Error using pyautogui "NameError: name 'ImageGrab' is not defined"

import pyautogui screenshot = pyautogui.screenshot() screenshot.save("screenshot.png") when executing this code gives me this error:    File   "C: \ Users \ User \ Anaconda3 \ lib \ site-packages \ pyscreeze__init __. Py",   line 312, in _s...
asked by 10.12.2017 / 01:46
0
answers

Django filtering last JSONField object

I'm trying to make a filter of a JSONField that has the following data: [ { "date": "2017-12-02T11:39:07.447677", "staff": "payment_in_process" }, { "date": "2017-12-02T11:39:12.700590", "state": "ASSIGNING", "staff":...
asked by 15.12.2017 / 16:08
1
answer

Get file path from the request.POST in Django

I want to obtain the path of a file that I upload using a form but when printing the field returns a type None . My models.py is this class Insumo(models.Model): nombre = models.CharField(max_length=50) file = models.FileField...
asked by 13.12.2017 / 14:42
1
answer

Error modifying elements in sublists, all end with the same content

Someone could tell me why I have an error in the following code: tabla=[] linea=['0'] for k in range (3): linea.append('') for k in range(12): tabla.append(linea) i=0 for k in ['1','2','3','4','5','6','E','F','P','G','2G','T']: tab...
asked by 27.09.2017 / 15:26
3
answers

Form a python string

I am trying to make a program that allows me to create a word, through letters entered by the user (It is assumed that you enter letters one at a time). I did it using a list, but when I print I get: ['h', 'o', 'l', 'a'] , and what I d...
asked by 07.12.2017 / 20:45
1
answer

Sort by attribute selected nodes with xpath [duplicate]

I am scraping a web whose information is in a table with the following structure. <tbody> <tr class='Leaguestitle'> <td>...<\td> <td>...<\td> <\tr> <tr id='tr1_abababa'>...
asked by 23.12.2017 / 21:50