Questions tagged as 'python'

2
answers

Django Custom Template Tags

Good afternoon, recently I have a problem in the Django framework, I have a problem in my custom template tag, I do the method in a .py file and I call it in templates and it does not display the result I want, can take a look please? Follow...
asked by 06.06.2016 / 22:59
1
answer

Obtaining data from excel and transforming into list, by Python

import xlrd def ler_arquivo(teste_termal1): tt1= xlrd.open_workbook('teste_termal1.xls', formatting_info=True) eajp60= workbook_r.sheet_by_index(3) Coluna_4=[3] Coluna_13=[12] return { "Ct":Coluna_4, "Sa":Coluna_13,...
asked by 11.11.2015 / 17:49
2
answers

How to create expression that returns 1,12,123,1234 in Python

I'm learning the basics of python and I came across an exercise where I have to build the following sequence: 1 12 123 1234 12345 123456 1234567 12345678 123456789 I think it's a simple thing to do, but can anyone h...
asked by 29.09.2015 / 16:39
1
answer

Transform query into dataframe [sqlalchemy + pandas]

I'm new to python and want to create a function that queries the database [mysql] and converts it to a dataframe so that it can be emailed in .csv format later. But I'm having trouble with this query conversion to the dataframe. Here's my...
asked by 06.10.2015 / 20:42
3
answers

Is there any way to use script as configuration files in python?

In PHP, we can use a PHP script to only return values, which is very useful for creating configuration files for an application. Example DB.php return array( 'host' => 'localhost', 'username' => 'username', ... ); i...
asked by 13.08.2015 / 15:44
2
answers

Developing a WebCrawler in Python [closed]

Is there any open source webcrawler project, developed in Python, for study? I've been studying / researching for some time, but I do not find anything ready about it. My goal is to study to create an open source with the following Features:...
asked by 03.11.2015 / 06:23
2
answers

Copy file contents to clipboard in Windows

Hello, I am making a software for a forum, where members consult the posting patterns by the software, I am storing these patterns in files and asking Python to read those files and display them, so the user copies the pattern. Now I want to a...
asked by 23.03.2015 / 15:08
1
answer

Dictionary with lists as value

I have 2 lists like the following: lista1 = [ {'Idade': '8', 'Especie': 'Gato', 'Nome do Animal': 'Felix'}, {'Idade': '57', 'Especie': 'Tartaruga', 'Nome do Animal': 'Michelangelo'}, {'Idade': '12', 'Especie': 'Cao', 'Nome do Anima...
asked by 24.04.2016 / 13:35
1
answer

How to implement "foreign key" using Micro Services architecture? Django

I am trying to build a system using the micro services architecture, I came across the problem about dependency, in the case how to implement chave estrangeira using this architecture? I'm using Django Example The class pedido...
asked by 25.04.2016 / 22:57
1
answer

PYTHON Saving a result in txt

I have this code that generates combinations of numbers When I squeeze, he starts the combinations what I want and that it save these combinations in a txt file import random c1 = (random.choice([9, 9])) c2 = (random.choice([1, 1])) c3 = (ran...
asked by 27.12.2018 / 01:19