Questions tagged as 'python-3.x'

1
answer

TypeError: integer argument expected, got 'str'

The error occurs in the login of a program, I have been reading and I found a solution with the open, but it does not work for someone to help me, thanks in advance. def login(): user2=str(input("Nombre de usuario:")) user__file2=open...
asked by 04.01.2018 / 15:16
2
answers

Is it necessary to use init.py for the packages in Python 3?

Is it necessary to use an init.py for a folder to be considered a package in Python 3.7?     
asked by 21.12.2018 / 15:03
1
answer

I need to do a consolidated product in Python

I have a list of dictionary objects like the following: productos = [ {'nombre': 'Jumbo maní', 'cantidad': 30, 'categoria': 'Jet'}, {'nombre': 'Jumbo maní', 'cantidad': 50, 'categoria': 'Jet'}, {'nombre': 'Papas de pollo', 'cantidad': 15, 'c...
asked by 22.12.2018 / 22:31
1
answer

How to run .php in python?

Good day, I have the following script in python that is called test.py : import subprocess subprocess.call(["php", "load_data.php"]) The idea is to run another script php in which I do LOAD DATA INFILE to a table...
asked by 18.09.2018 / 01:11
0
answers

Challenge solution of the 8 queens in python

What the challenge is: Hello people, I do not know if you know the challenge of the 8 queens. If you do not know it, I'll explain it to you shortly. We have a chess board like any other and you have to place 8 queens on the board without bein...
asked by 09.06.2018 / 05:13
1
answer

How to load a large volume of data with Django Querysets?

I have a loading process in a Django project which from an excel file stores information in a Business model. My loading process works, the problem is that the execution time is too high due to the data volume of the excel input. Model.py...
asked by 14.05.2018 / 17:29
1
answer

Problem with proxy request

I am developing a bot telegram, for the company that I work, the problem is that I can not have an input or output, because the connection is conditioned by proxy, but from browsers if I have access to the internet. Now try to configure the i...
asked by 24.09.2017 / 18:22
0
answers

How to modify kwargs in Django?

I am making the confirmation page of a purchase and I want to pass a hash of the order identifier, previously generated by the system, to a url and with a decorator to check if the user that is accessing is the owner of that order by a decorator...
asked by 19.04.2018 / 11:02
1
answer

Display radio button in django?

Hi, I have this problem ... I can not manage to display the radio button in the template ... in which I'm wrong? models.py class Genero(models.Model): MASCULINO ='mas' FEMENINO ='fem' Type_CHOICES = ( (MASCULINO,'masculi...
asked by 05.02.2017 / 02:14
2
answers

End while loop with break, but still in infinite loop

I'm starting in Python and programming in general and now that I had a few notes in hand, I started writing a simple program that consists of a menu with different options. The first consists simply of a loop that allows you to enter ages in...
asked by 26.08.2016 / 14:55