Questions tagged as 'python'

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 / 14:03
1
answer

Problems with the reference fields in the tables

I have these tables: db.define_table('marcas_definiciones', Field('marca', 'string', label=T('Marca GG')), Field('razon_zocial_gg', 'reference razones_zociales_gg'), Field('ruc', 'string...
asked by 02.01.2016 / 16:25
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 / 21:31
1
answer

Views and render () in Django

I am learning to use Django (specifically version 1.9). However, when creating a view, and when starting the Django server, I have the following error: TypeError: render() takes at least 2 arguments (1 given) What I do not understand is, wh...
asked by 15.12.2015 / 19:51
4
answers

For nested in python

Good, I have a list and I want to iterate on it, and then inside that for iterate on the same list from the next value I read until the end. In a Java-like programming style it would be: int[10] array; for (int i=0; i < array.le...
asked by 08.05.2016 / 15:01
1
answer

Get the duration of a video on django

Hi, I would like to know how I get the duration of a video on django. I will show you what I have so they know what I have tried I've tried using these examples: link but you can not because those codes receive the name of the file as a...
asked by 21.08.2016 / 20:44
1
answer

Show items while typing in the search engine in django with ajax

In link this is a search engine that shows some results while typing in it. But now what I want is that it does not show those results if I do not change the list of spells while I'm typing there. Something like what google does, I think it is...
asked by 23.09.2016 / 12:58
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 17.09.2018 / 23: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 / 03:13
2
answers

Extract cell data using pandas

I have a table in csv format with more than 30 columns with values of 0 per row, but some columns have values. Then I would like to use Pandas to extract those values and store them by Zone # Area # and Ptc # and store the values according to th...
asked by 23.06.2018 / 15:17