Questions tagged as 'python-3.x'

5
answers

How to kill a while loop True with the enter key

How can I end a while while True cycle using a line break? I have this little function: def number_add(): print("3[1;33m"+"Please enter two numbers: \n" + "3[;36m"+ "Operator 1: ", end='') a = input() print("3[;36m"+"Operator 2: ",...
asked by 21.11.2018 / 05:13
0
answers

Generate blur effect in QmainWindow python

Good evening I would like you to help me put a blur effect in a window in pyqt the result that I hope is something like this: this is the code: import sys from PyQt5.QtWidgets import QMainWindow,QApplication, QGraphicsEffect,QGraphics...
asked by 25.11.2018 / 01:31
0
answers

Group by 2 independent columns

I have a Dataset with millions of records that I want to group using pyspark by 2 independent columns, I'll give you an example: I have: ID Col A Col B 1 Alicia Madrid 2 Pepe Barcelona 3 Pepe Madrid 4 Juan Cadiz 5 Alicia Sev...
asked by 19.11.2018 / 18:02
1
answer

parsing a text file with python

I am new to the platform and to the world of python. I would like to be able to make a small script in which I give a file.txt, which contains a text string separated by | , and for each | that there is a line break (I understand it would be...
asked by 19.11.2018 / 19:13
0
answers

How to find the mouse coordinates in Python?

I need to know if there is any way to get the coordinates (x, y) of the mouse when I click on a window created with the turtle library. (Only using the libraries installed by default in Python) Thanks.     
asked by 18.11.2018 / 13:14
0
answers

Show image loaded with the administrator

I have Pillow installed, Django 2.1 and a model with an ImageField field that places the loaded images in the "images" directory. In the form from the administrator I can load the image and it is stored in that directory (/ media / images), b...
asked by 16.11.2018 / 22:06
0
answers

Google Sheets with Python

I'm trying to upload some data to Google spreadsheets with Python. For this I use in module requests. I have managed to read a spreadsheet without problem using this code: import requests import json url = "https://sheets.googleapis.com/v4/s...
asked by 15.11.2018 / 12:23
2
answers

I need to solve a Django problem - manage.py createsuperuser | UnicodeEncodeError

When executing: (env) luis@ux-pc:~/projects/administrador-webapp-django$ python3 manage.py createsuperuser Nombre de usuario (leave blank to use 'luis'): superusername I get a Unicode error: Traceback (most recent call last): File "mana...
asked by 15.11.2018 / 04:01
0
answers

Run subprocess.run on a terminal other than the one that executes the Python script

I'm writing a program in Python3 with a Tkinter GUI. I have included a terminal xterm in one of my frames: Frame2 = Frame(master) Frame2.place(x=self.anchoVentana,y=2*self.alto/3,width=self.ancho-self.anchoVentana,height=self.alto/4) w...
asked by 14.11.2018 / 11:35
1
answer

How to move between directories in python 3 with the linux operating system?

I try to move directory in python 3 but it gives an error: import os os.system("cd /") I tried this one but it does not work either: import os os.chdir("cd /") In this case, I use the operating system parrot os 4.2.2....
asked by 13.11.2018 / 01:41