Questions tagged as 'python'

2
answers

What is the main difference between a Tuple and a List?

What are the differences between Tuple and List in Python ? Example: >a = [1, 2, 3] # [1, 2, 3] >b = (1, 2, 3) # (1, 2, 3) The Tuple , grotesquely speaking, is a constant that accepts List ?     
asked by 03.03.2015 / 16:12
1
answer

Errors being generated when converting python code to exe with cx_freeze

I did the conversion of the file tucha.py to exe following the instructions and with the following setup.py: from cx_Freeze import setup, Executable setup( name="tucha EXECUTABLE", version = "1.0.0", description = ".py to...
asked by 24.12.2016 / 03:20
1
answer

How do I create 2 forms simultaneously Django

What I want is in a single templante bring these 2 forms simultaneously, in separate pages works, but the two together still could not do. Do I need to do an intermediate form? Am I doing wrong at some point? ... forms.py from django import...
asked by 19.12.2016 / 12:28
1
answer

Inheritance of templates with django

I'm having a problem with applying temeracy to django. Apparently this is all right however my html child is not rendered in the template base.html <!doctype html> {% load static %} <html lang="en"> <head> <meta cha...
asked by 19.12.2016 / 22:32
2
answers

Library Os / python

This program aims to show a certain type of file you have in a folder. But it's giving the following: erro: WindowsError: [Error 2] O sistema não pode encontrar o arquivo especificado: 'pythonteste'. Could anyone help me solve this problem...
asked by 09.12.2016 / 02:44
2
answers

PIP does not work on virtualenv

After activating virtutalenv the pip does not work, I get the following error wilker@debian:~/Documentos/Git/Curso Django/Blog$ source bin/activate (Blog) wilker@debian:~/Documentos/Git/Curso Django/Blog$ pip freeze bash: /home/wilker/Document...
asked by 09.12.2016 / 03:03
1
answer

problems with exec php

I made the following command in php $comando="C:\Python27\python.exe programa.py"; echo $comando; in the python file print resultado; This result variable has the content formed in json { "algumacoisa":"algumac...
asked by 05.12.2016 / 00:53
1
answer

Import model class attributes from another app

Good afternoon guys, I'm good, a doubt! I'm using 2 Apps in django admin App1 = Registration App2 = Controllers control I imported the app1 model, the "Person" class into the "Scholarship" class, but it only takes the "Name" attribute a...
asked by 27.01.2017 / 05:57
1
answer

Multiplication of arrays in Python

Hello, I'm doing an algorithm in python that makes the product between two arrays, but I'm having trouble displaying the resulting array matriz = [] linha = [] linha2= [] matriz_result = [] result = 0 lista = [] nlin,ncol= map(int,input().spli...
asked by 28.11.2016 / 03:26
1
answer

getch python returning without using

I am trying to use getch of python to get the key the user pressed, but without pressing anything it is returning " b'\xff' ", and if I use ord(getch()) , it returns 255. If I can help thank you. from msvcrt import getch ke...
asked by 26.11.2016 / 21:18