Questions tagged as 'python'

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

Correct use of the django admin app [closed]

What is the correct use that should be given to the administration page (django.contrib.admin) in a production application . I explain my question. The administration site allows you to manage the models created in a fairly simple and abstra...
asked by 15.10.2016 / 02:12
3
answers

Change a string value to an integer

With the following code I want to make a validation where validate if a data that I am going to enter is greater than another that I already have, if so, an error message should appear. This is what appears to me as you see the value celda...
asked by 18.10.2016 / 21:05
1
answer

Import modules in python

What is the difference between importing a module with import nombremodulo and from nombremodulo import * ? Following several books I have noticed that there are modules that import them in the first way, such as the module os...
asked by 22.12.2016 / 03:59
2
answers

How can I use the command (cd ..) in python

I have made a program in python client-server but I can not use the command in cd in shell mode which are the commands I use for msdos. I have been told with threads you can do I have used this: x = input("introduce el comando: ") subprocess.c...
asked by 01.08.2016 / 15:57
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

alternative to LOGIN_REDIRECT_URL in django 1.9

I know that even in Django 1.9 it works LOGIN_REDIRECT_URL , what happens I want an alternative to LOGIN_REDIRECT_URL since support for this will be removed in Django 1.10     
asked by 15.04.2016 / 02:06
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

How to generate a matrix with a list that contains data?

Cordial greeting. I have a list of the following form. L=[1,2,3,4,5,6,7,8,9,10,11,12] and I want to generate a 4x3 matrix with that list and with that data, in such a  so I have something like this: M=[[1,2,3],[4,5,6],[7,8,9],[10,11,1...
asked by 21.04.2016 / 21:51
1
answer

MySQL query from Python

I'm looking for a way to make a query to MySQL from Python, for this I'm supporting the documentation official . The problem is that although I can connect and do the query without problems, I am unable to go through the results, look for the d...
asked by 01.01.2018 / 06:51