Questions tagged as 'python-2.7'

2
answers

How to export to PDF in Django?

I'm using Django 1.8 and I want to export an HTML document to PDF, for this I use wkhtmltopdf, in addition to other libraries I had to import the following and the file view.py was like this: from django.views.generic import DetailView from wk...
asked by 04.05.2017 / 19:03
1
answer

Adapt a dataframe to a range of dates

my doubt: I have a df (with Fecha as index and another column Cantidad ) with records every 3rd day from 2016-05-03 until 2016-05-20, example:    df.index [   2016-05-03,   2016-05-05,   2016-05-07 ...] With: df = df....
asked by 05.05.2017 / 16:16
2
answers

Compile Web2Py in .exe with CX_Freeze

Dear, I have a problem, I want to convert the app created in Web2Py in an .exe app, but when I run cx-freeze it tells me this error: Traceback (most recent call last): File "setup.py", line 10, in <module> from cx_Freeze import...
asked by 10.05.2017 / 13:09
1
answer

When referencing a variable of a class: it does not save data

When I create my class, I create a variable called self.canvas_height= self.canvas.winfo_height() in which I store the result number of a method I invoke. So much the better but after that same class I create a function dibujar where...
asked by 17.02.2017 / 16:33
2
answers

How to update values contained in Radiobutton to use them in a Python Tkinter function?

I am trying to place three options using the Radiobutton widget to later use the value of the option selected in a function when a button is pressed. I have found scripts where a variable of type IntVar is defined and then the method...
asked by 07.03.2017 / 19:50
2
answers

Collect x samples of x simulations

The following code generates a CSV in which a series of columns are displayed (PLAYER, SIGNAL, ROUND1, ROUND2, ROUND3). In the columns "RONDAx" appear the times that each player has shown a determined signal in each round throughout 1000 simulat...
asked by 12.01.2017 / 14:21
1
answer

Assign values depending on the initial lists

In the following code we have: pairings: variable that tries to represent pairs of players. In the example, player 1 plays with player 2 and player 3 plays with player 4. V1, V2, V3, V4: are variants or symbols that players show their oppo...
asked by 01.01.2017 / 19:14
1
answer

Python - Django - Sum too slow from a list

I have a Django project related to energy consumption, through which I visualize the consumption of a household during a month. To obtain that information, I use the following code: consumos = Measurement.objects.filter(idhogar=hogar) filtrado...
asked by 02.03.2017 / 11:02
1
answer

Create a match query in 2 tables with elasticsearch 2.3

As I can make a query between 2 tables, I have the following tables Company: - id - name - domain - timestamp Target - id - name - domain - company - website - company_id - timestamp User - id - firstName - lastName - email - company_id -tim...
asked by 16.11.2016 / 04:35
1
answer

Error method post Requests in python

I'm doing a script that makes me a POST method. I follow the library documentation requests . I have to make a login; when I use the method GET no error arises. It consists of several tags with enable ( value=1 ) and...
asked by 05.10.2016 / 13:58