Questions tagged as 'python'

1
answer

How can I check that the FTP login has been made?

Is there anything that can help me know if the login has been made or, if it has not been done, send a message to my log? ftp = FTP(dirServer) ftp.login(user=usuario, passwd=passwd)     
asked by 08.11.2018 / 14:17
0
answers

How to get the python GAP (pulp)

I'm working with python specifically with the PULP library, I have a model that runs, but I want to be able to extract the GAP from the solution to save it in excel and be able to make comparisons. This is the line with which I specify that t...
asked by 08.11.2018 / 13:40
1
answer

how to iterate row by row in pandas

How can I iterate row by row in a dataframe using python: For example, I have the following data: canciones={'albun':['cacho','beto','pedrito','loshermanos'], 'ano':[1992,1998,1994,1993], 'tiempo':['00:22:04','00:42:02','00:23:33...
asked by 03.11.2018 / 20:00
0
answers

virtualenv creates two python and python3 files

at the time I created a virtual environment and tried to activate it, I said that the "activate" file did not exist, when I entered the folders to see what was happening, I did not have any file other than one that said python and another that s...
asked by 02.11.2018 / 17:02
0
answers

TypeError: can not unpack non-iterable NoneType object

I have a function that after making several calculations ends with 3 float variables. When I return them I get the following error, what does it mean?    TypeError: can not unpack non-iterable NoneType object def funcion(): ... a =...
asked by 02.11.2018 / 19:14
0
answers

is it possible to use a loop with this line of code that uses index?

This is the line that I do not know if it can be put in a loop: segunda_m = segunda_m[-1] + segunda_m[-2] + segunda_m[-3] + segunda_m[-4] #abajo esta todo el codigo completo. es simplemente sumar index. #El primero es -1 el segundo es -2 y asi...
asked by 03.11.2018 / 23:19
0
answers

TypeError: append () takes exactly one argument (2 given)

Hello colleagues, you could tell me why it appears in this code when I run it: TypeError: append() takes exactly one argument (2 given) when I add the positions in list 3. And another thing: whenever I take out cousins, programs work w...
asked by 03.11.2018 / 22:35
1
answer

How should you define a regular expression to get the month and year numbers of a date in MySQL?

I would like to obtain the two numbers that correspond to the month of a date in dd-mm-yyyy format using MySQL. So far this: ^\w{2}-("+month+")-+("+year+")$ Using Python, exchange month and year for the corresponding variables, leaving f...
asked by 01.11.2018 / 19:02
0
answers

Refer to a widget outside the class - Tkinter - Python3.6

I have an application where I have my main code in a file called main.py and the functions and classes in another file called events.py. Well I have a class like this and what happens to me is that anywhere in the code I can put self.label and I...
asked by 02.11.2018 / 13:28
1
answer

Do not let me import the discord library from python

I'm trying to make a discord bot and I'm not sure about the import of the first line, I do not know why. import discord from discord.ext import commands from discord.ext.commands import Bot Cliente = discord.Client() cliente = commands.Bot("!...
asked by 02.11.2018 / 13:54