Questions tagged as 'python-3.x'

1
answer

local variable referenced before assignment

I am having problems with this code, it appears that the variable specified in line 242. (Marked): totalCompra= totalCompra + int(aux2[2])*int(itemAmount) UnboundLocalError: local variable 'totalCompra' referenced before assignment I...
asked by 09.06.2018 / 02:31
1
answer

sublime repl and python3, not configured. work in linux

use linux mint 18 sarah. my problem is that I do not know how to say sublime text when installing the package sublimeREPL that is installed in python 3 and not in python 2 because the latter is installed by default in linux but I want to use...
asked by 28.05.2018 / 16:51
1
answer

Read multiple lines in a file in python

Hello friends I am creating a file with functions in python and I need to make a function that can add the whole numbers that contain the lines that are inside the file, I have managed to make me only read the first line with the function fic...
asked by 25.05.2018 / 19:21
1
answer

Placement in MultipleChoiceField template in Django

I'm doing a web page in Django and I want to introduce a MultipleChoiceField in a table. I want to introduce it in a personalized way, but when using the template code it does not give results. Here I leave the codes and the result. forms.p...
asked by 08.05.2018 / 08:59
1
answer

Trying to recreate the ls -l command in Python

I have been creating a bash simulator in windows using python for some time, at this moment I am programming the command: ls -l The problem is that I do not know how to make the following data in the file or folder print: permissions...
asked by 30.04.2018 / 05:02
3
answers

Delete elements in two lists based on the value that element has in that position in one of them

I am creating a program that loads data into two lists, diámetro and altura , and I have to delete the data from both lists when the second list, altura , has the value 0. This is the code: a=0 for i in diametro: for...
asked by 22.04.2018 / 20:08
1
answer

Hello, I have a problem with the hangman game in Python

Well I have the game and I do not know how to do that in the variables ( tupalabra and palabra ) I choose the list that I created from random words in order to start playing. Because I have them empty and it shows me that I have alr...
asked by 29.05.2018 / 20:16
1
answer

Enter characters continuously in the terminal without pressing Enter

I would like to create a program that would read characters entered by the user but continuously, without having to press Enter every time I type one and stop reading, for example, when entering a '.' Something like: palabra = [] while T...
asked by 15.04.2018 / 21:49
1
answer

Error sending value to a variable

I have this code that is from a media player however I get an error when trying to send the value of the selected file to the variable VIDEO_PATH . Here is the code: import sys from functools import partial from PyQt5.QtCore import QE...
asked by 27.03.2018 / 03:29
2
answers

Read an operation

I want to make a program that reads an operation to me and performs it, for example I enter it: Input operación=input('Ingrese la operación')    For example, operation outside 4/2 Output 2 I try to do with an entry that takes it as...
asked by 17.03.2018 / 04:20