Questions tagged as 'python'

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

convert .txt file to two-dimensional array with python

I have a file .txt with a lot of information, I want to read it with python but at the same time I read it I need to fill a two-dimensional array taking the word or the data separated by the comma as a position and not each character as a...
asked by 27.03.2018 / 21:29
1
answer

Generate HTML with Python

I'm trying to generate HTML with Python, what I want to show is just a string, but for some reason it does not take into account the string, I hope you can help me def html_create(self,result): template = open("template.html","r") outp...
asked by 16.04.2018 / 17:29
2
answers

.py file does not exist in django's cmd (Windows), how do I add it?

I just installed what bitnami 2.0.4 is in its latest version and I have a problem wanting to create a new project, by doing the command django-admin.py startproject myproyect At first I got an error that the django-admin file did not exist...
asked by 08.04.2018 / 03:01
1
answer

How to export Matplotlib graphics with Reportlab?

I'm creating a graphical interface, with python and the tkinter module, the interface has to generate a graph and if I click on the export button I have to generate it in a pdf with the Reportlab library. How do I export it? import matplotli...
asked by 22.05.2018 / 19:10
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
1
answer

Edit python file

I need to do a small program in python to edit a file with superuser permissions. I think it's pretty simple but I've never worked with file management in python. I have a file that according to an entry or value of a variable, I would have t...
asked by 20.03.2018 / 07:22
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
1
answer

Modify template name Django

I am generating a view to search for products and I want to modify it to also search for users when the name starts with '@'. Right now I have this view: class BusquedaView(FilterView): model = Producto filterset_class = BusquedaFil...
asked by 16.03.2018 / 17:16
1
answer

KeyPressEvent does not detect key 0

I'm trying to capture the keys I press within QLineEdit , but the keyPressEvent() method does not return any results when I press any number or letter it just seems to react with key_Return : This is the sample code: impo...
asked by 21.03.2018 / 21:24