Questions tagged as 'python'

1
answer

How to use model variables in a view in Django

I need to calculate the age of a school report card where the data is filled in Django Admin, I would like to get each value to media and play in a table in the View. Code: MODEL class Cadastro_Boletim(models.Model): ra_aluno = mo...
asked by 30.11.2017 / 14:36
2
answers

How to count the records of a csv in python?

I'm a beginner in Python and I'm having a hard time. I have a separate CSV database for ";" with 6 columns. I'd like to count how many records they have, whose sex is "Female." Can you tell me how to do or where should I start my studies?...
asked by 16.10.2017 / 19:17
1
answer

My code builds always incorporate Python 2.7 instead of 3.6, how to solve?

When I create programs executables I have suffered with this, and if anyone knows how to help, I thank you. Follow the command line that I usually use to build at the prompt.    python 'filename' .py build     
asked by 10.10.2017 / 01:55
1
answer

How to transform a python file into an executable? [duplicate]

If I create a python application and want other people to use it, will other people have to install python to run it or is there a way to make it executable? And to create an installer for this application I need to learn another language?   ...
asked by 13.10.2017 / 14:44
1
answer

API tips for bitcoin quota checking [closed]

Hello, I'm new to this bid from Bitcoin, and I've looked for some APIs to check the currency quotes, however the ones I found I did not quite understand how they work, someone who understands more about the subject can help me recommend some easy...
asked by 13.10.2017 / 01:37
2
answers

Using Python module in Django

I'm starting with Django and Python now and I have a question that might sound silly: Can I use python modules and functions - and others installed - usually in a Django application?     
asked by 05.10.2017 / 21:34
1
answer

Dictionary as input argument is being modified within function

In the code below the dictionary used as input argument is also being modified by the function. Do I have to% always%? def muda(a): a['valor'] = 50 return a dic1 = {'valor': 12} dic2 = muda(dic1) print(dic1) {'valor': 50} print(dic2)...
asked by 05.10.2017 / 02:46
1
answer

Python only replaces PHP or replaces PHP and apache?

The first language I learned was PHP, unfortunately. PHP runs along with apache, but I wanted to use python instead, but the tutorials I found about python for the web make it look like it would replace apache, is that right? Do I have to config...
asked by 05.10.2017 / 14:17
1
answer

Quicksort in ascending order in Python

I need to sort the number of times the words are repeated in the txt file, but every time I slash the code, it's printable in descending order. Code below: from collections import Counter with open('/Users/DIGITAL/Desktop/Python/teste.txt'...
asked by 08.10.2017 / 04:25
1
answer

Straight brackets (brackets) wrong?

I have this function in Matlab cn = reshape(repmat(sn, n_rep, 1), 1,[]); In Python I have the following code: import numpy as np from numpy.random import randint M=2 N=2*10**8 ### valor de Dados n_rep = 3 ## numero de repetições sn = ran...
asked by 07.10.2017 / 00:27