Questions tagged as 'python-3.x'

0
answers

how to use plt.xticks () to show dates (in days) in python?

I have the problem that I put the date on the x axis but it only gets in one part like the image together all day to the left the data is for the whole year and I want it to show days or months   plt.title("sacramento") plt.xlabel("crime...
asked by 23.08.2017 / 20:38
1
answer

cx_Freeze, "ImportError DLL load failed"

I created a code for an interface with Tkinter , reportlab , openpyxl among others. Everything inside my .py file works very well but when creating an executable (.exe) with cx_Freeze the following error occurs: I appreciate any...
asked by 24.08.2017 / 01:27
1
answer

how to add words separated by letters to an arrangement

n = int(input()) m = int(input()) matrix =[] for i in range(n): matrix.append([]) for e in range(m): matrix[i].append("") so I make my arrangement Now I want to add letters in each position as I can. Example: entry...
asked by 08.03.2017 / 15:39
0
answers

REST API - Serialized models do not take hostname from the production server - Django REST Framework

I am exposing an application (at the moment it is only your user scheme) with Django Rest Framework, and it happens to me that every model that I have serialized, in the url attribute, I have is the address of the localhost of my development mac...
asked by 20.02.2016 / 19:15
3
answers

Is it possible to limit the consumption of resources so that the equipment is not left unused?

Sometimes my scripts require a lot of resources and the equipment is left unused. I would like to know how to limit the access of my scripts to the resources of the computer. For example, do not let him use more than 50%. I use the interprete...
asked by 30.01.2018 / 11:22
1
answer

Read a dictionary from a text file in Python

I am trying to read a dictionary from a text file, this file has a structure like the following: {'foo': 2, 'hola': 'Hello world!'} I have researched and there are recommendations to use the JSON module but I would like to know if there is...
asked by 05.06.2018 / 22:00
1
answer

"SimpleHTTPServer" in Python 3

In Python 3, what would be the equivalent of python -m SimpleHTTPServer ?     
asked by 17.06.2016 / 12:06
3
answers

syntax error in python 3?

Why does syntax error appear when executing this block? I can not find the reason: for Empleados in cursor: emplead = '\t'+ str(Empleados[0]) + '\t'+ str(Empleados[1]) + '\t' + str(Empleados[2]+ \ '\t' + str(Empleados[3] +'\t'...
asked by 13.07.2017 / 23:46
3
answers

Evaluate if a list of integers is triangular in python

By means of a python script I want to evaluate if a list is triangular, that is to say if it is increasing up to a certain element, and from that element it is decreasing. For example, the list [2, 4, 5, 7, 4, 3] is triangular, while the list [2...
asked by 26.09.2018 / 00:39
3
answers

How do you compare 2 dictionaries to know if they have the same item or key?

I need to compare 2 dictionaries and return a dictionary with all the elment of both. Example: dic1 = {'a': 2, 'e': 5, 'u': 1} dic2 = {'a': 3, 'e': 2, 'i': 2} then return one of the two complete with all the elements: dic1 = {'a': 5, 'e':...
asked by 05.10.2018 / 22:57