Questions tagged as 'python'

2
answers

Backtracking Algorithm with conditional Python

I am trying to solve an exercise that I think is quite simple, given a list, print all the possible combinations / permutations of x elements. That is, take out all possible combinations but give a filter for the results. At the moment I have...
asked by 07.12.2016 / 11:30
1
answer

When using django-cassandra-engine sessions I get an error in INSTALLED_APPS

I'm using django-cassandra-engine for session storage, when I start the server I get this error: RuntimeError: Model class django.contrib.sessions.models.Session doesn't declare an explicit app_label and isn't in an application in INSTALLED_AP...
asked by 01.08.2017 / 22:35
1
answer

Redirect a URL from a class-based view to another

When moving my WordPress blog to Django I changed the structure of the permanent links, before I did not use category in the structure and now yes. More or less like this: /slug/ ⟼ /cat/slug/ And then I'm getting a lot of 404 errors,...
asked by 03.08.2017 / 17:45
1
answer

How do I create a pipeline in python-social-auth, fill in data in a form?

I need to make a registration using python-social-auth and Django, which uses Facebook data to pre-fill some fields of the user creation form. Does anyone know how to do it?     
asked by 02.09.2016 / 21:11
4
answers

Error executing pip install mysql-python

I'm trying to execute the command in windows: pip install mysql-python to be able to work with mysql in Django but I get these errors: c:\users\fabia\appdata\local\programs\python\python35-32\include\pyconfig.h(243): fatal error C1083:...
asked by 19.10.2016 / 04:12
1
answer

Invalid type error

I wrote this code: import random continuar=1 while continuar ==1: print("Bienvenido a mistermind") print("Elija el nivel de dificultad (1=facil, 2=normal, 3=dificil") dificultad=int(input("escoja el nivel de dificultad: ")) i...
asked by 10.07.2017 / 16:28
1
answer

Upload files to S3 using Multithreading in Python

I have a folder with thousands of files to upload to my S3, for now I do it like that, without problems: for x in images_full_path: data = open(x,'rb') name_file = os.path.basename(x) s3.Bucket(bucket_name).put_object(...
asked by 11.07.2017 / 16:15
1
answer

How can I read or print a block of lines or data from a file, between two lines or two keywords within the file in python?

I have several files with the same format and I want to read a block of those files from the line where the numbers or data of the time, voltage and current appear, until the line 'final data', this would be an example or something similar to th...
asked by 20.04.2016 / 15:48
1
answer

Can I share a Python program (3.x) with someone who does not have it installed?

My first language was c and as you can imagine the differences with python-3.x They are remarkable. Python is object oriented and an important difference for a novice in Python as its server is that while C is compiled, Python is interpreted...
asked by 15.04.2016 / 23:36
1
answer

unsupported operand type (s) for +: 'NoneType' and 'NoneType'

I am trying to save elements that I parsed from a csv file in the database and at the time of splitting those elements I get an error unsupported operand type (s) for +: 'NoneType' and 'NoneType'and I do not know what do. def Procesar(request,...
asked by 25.04.2016 / 18:01