Questions tagged as 'python'

1
answer

Pandas writes field names when exporting CSV Python

I am programming a small development, but I have problems writing to a CSV I do not want panda to write the name of the fields, but I could not delete this option, I read the documentation and added the argument "index_label = False" e " index =...
asked by 10.08.2017 / 18:38
2
answers

Overwrite Django's logout method

I have activated in settings SESSION_EXPIRE_AT_BROWSER_CLOSE so that when the browser is closed the session is closed. I have a function so that when the session closes I do some tasks in a table of the database, it works correctly....
asked by 12.09.2017 / 20:09
1
answer

Receive emails with Python

I am trying to receive with Python the emails that I have in my Gmail. I connect without problems to my account and I get the mail from the one who sent the message, the subject or the delivery time, but there is no way to get the body of the me...
asked by 10.09.2017 / 18:44
2
answers

I do not get a raise with ValueError

I have the following code: def sum_digits(s): r = ''.join(x for x in s if x.isdigit()) newList = list(r) try: result = sum(int(i) for i in newList) except: raise ValueError return result print(sum_digits(...
asked by 28.07.2017 / 17:26
2
answers

Problem with input in python

Good morning. I am creating a function that receives two parameters. Such a simple function that carries out the process of adding two numbers. But when I go to the console when I ask for the numbers I have to use two input. one for the first nu...
asked by 18.07.2017 / 04:25
1
answer

Launch program with Python or with cmd

Good morning, I hope you can help me. The fact is that I want to launch a program with a Python script. The first thing that came to my mind was using the os module in the standard Python 3 library. It would be something like: import...
asked by 19.07.2017 / 04:08
1
answer

The form.is_valid () function does not work in Django

I hope you can help me in advance thank you very much, it turns out that I have a form that I need to fill with information from my database before sending it to the template, but it turns out that when I want to evaluate it using the POST metho...
asked by 21.07.2017 / 22:36
1
answer

File generated with py2exe fails to run

I have the following code: ''' Archivo: setup.py ''' # -*- coding: utf-8 -*- from distutils.core import setup import py2exe setup(name="Ejemplo", version="1.0", author="autor", author_email="email del autor", url="url del proyecto...
asked by 10.07.2017 / 04:58
1
answer

Subs in a python list

I have a small program in Python that calculates 4 equations based on a function and its derivatives. The problem comes when I use the solution of the first equation and try to replace it in another equation. I get the error of:    the lis...
asked by 13.07.2017 / 09:38
1
answer

How to transform an api query saved with ElasticSearch into a text variable?

I want to transform the following result of a query into an API saved with ElasticSearch in a text to be used later. b'{"BTC":{"USD":2403.99},"ETH":{"USD":222.1},"DASH":{"USD":179.04}}' b'{"BTC":{"USD":2402.89},"ETH":{"USD":222.1},"DASH":{"USD...
asked by 13.07.2017 / 02:55