Questions tagged as 'python'

1
answer

Show MenuBar when loading the program

In this example of a screen with menus, when I execute the code, first, the Menu does not appear at the top (in the title bar). import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk # gsettings set com.canonical.Unity alw...
asked by 27.04.2018 / 14:20
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
1
answer

how to import a module if there is one with the same name in python

I have two main.py files, parser.py and I want from main.py to import parser.py but it does not matter what parser.py you create, what matters is a parser builtin module. How can I get the file that I create to import without having to change th...
asked by 04.05.2018 / 18:12
1
answer

Problem in Python [REPEATS AND DOES NOT GIVE THE NAME OF THE DETAIL]

I have a problem in Python which is the one above, I tell you what the program is about, the user enters a word in this case "MARKET" and gives a value of "10000" is repeated in the following, but when the detail is shown, two or intermedi...
asked by 04.05.2018 / 00:59
1
answer

I can not detect xpath on Twitter

Since yesterday I have been trying in Python, with Selenium, to create a bot that allows voting a poll. The process from the beginning of the session until the vote is done perfectly, but when I indicate the xPath of the option to vote, it does...
asked by 24.04.2018 / 09:42
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
2
answers

How to install PyQt5 in Windows

I tried to install PyQt5 but it gave me the following error Does anyone know how to fix this, how can I install it?     
asked by 10.04.2018 / 19:12
1
answer

Error wanting to convert an int to a tuple in python

def negativo_grises(im): tiempoIn = time.time() ruta = ("C:/Users/HardSoft/Desktop/Imagenes/" +im) im = Image.open(ruta) im.show() im6 = im i = 0 while i < im6.size[0]: j = 0 while j < im6.size[1]...
asked by 15.04.2018 / 04:42
1
answer

Help get the remainder in python

I get this error and I do not know why it is: line 15, in toBinario residuo = ip%2 TypeError: not all arguments converted during string formatting This is my code: def toBinario(ip): binarios = [] residuo = 0 resultado =...
asked by 31.03.2018 / 06:02