Questions tagged as 'python-3.x'

2
answers

.isalpha () with spaces does not work in Python 3x

equipos = ["Barcelona", "Real Madrid", "Manchester United", "Ajax"] print (equipos[0]) print (equipos[1]) print (equipos[2]) print (equipos[3]) while True: equipo = input("\n¿Con que equipo te gustaria jugar? Escribelo aqui: ") if equi...
asked by 21.02.2017 / 11:39
1
answer

Python element IN list of strings

I have the following list and string: lis = ['ejemplo 1', 'ejemplo 2', 'cualquier cosa'] palabra = 'ejemplo' But when I do palabra in lis Returns False . For what is this? How can I solve it?     
asked by 02.12.2016 / 18:21
3
answers

How to run Django in python 3.5

I'm working with Django in python 2.7, for that I use virtualenv, pip, the mysql connector, etc. I have predefined python 3.5 in bash, but even so when I run ./manage.py shell it runs with python 2.7. How do I change it to python 3.5? Thank you...
asked by 22.10.2016 / 22:55
1
answer

Calculate memory in python

Good, I need some way to calculate the amount of memory that has been necessary to execute a series of instructions in Python. Something similar to time.clock() , but for memory, some help.     
asked by 11.07.2016 / 04:35
1
answer

Encryption of SHA1 algorithm with Tkinter

Hi, I'm doing an SHA-1 algorithm exercise with Python 3.4 and Tkinter My problem is that I do not know how to show the result of the conversion of my caja1 to the caja2 . Here is the code: from tkinter import * from hashlib i...
asked by 02.04.2016 / 19:20
2
answers

In classes how can I put a dictionary in a list?

Good, my doubt is probably very basic but I am not able to solve it. It basically consists of how I can add my turtle dictionary to the turtle list. I've tried with append but it tells me that turtles are not defined, any suggestions? The exampl...
asked by 28.12.2018 / 14:50
2
answers

Print certain pandas rows

I have a dataframe similar to the following: I want to show those columns that any of their rows contain a NaN, NaT or None. If I apply the following code I see what they are: def null(x): return any(pd.isnull(x)) print df.appl...
asked by 09.12.2018 / 19:39
1
answer

Count line breaks in a file.txt with Python

I am doing a lexical analyzer for a class and one of the things that it must accomplish is to count the line breaks. How can I count the line breaks in Python from a text file? This is my code, am I using regular expressions? **def newLine(lin...
asked by 12.12.2018 / 08:41
2
answers

Error DeleteView

Hi, I have a problem with my DeleteView in Django 1.8, I get this error:    TemplateDoesNotExist at /eliminar_tipo_almacen/38/appkardex/tipo_almacen_confirm_delete.html views.py: from django.views.generic import ListView, Updat...
asked by 27.01.2016 / 02:17
2
answers

Infinite while loop - python

This exercise is a simulation of a ship arrival system playing with random numbers. Initially, a random number is run to know how many ships arrive during the day. immediately another is generated to see how many ships from which they arrived ca...
asked by 02.11.2018 / 19:31