Questions tagged as 'python'

1
answer

Line change in array

Hello. I was programming in python and wanted to do the line switching (between the second and third line) of an array using the following code. But I wanted to know why the variable auxLinha changes value when I modify b[inicio]...
asked by 01.12.2016 / 04:43
1
answer

Python - Open multiple files in a For

Someone, please, could you help me explain why I can not add the texts of each file in each position of my list? ''' Funções para o processamento dos textos (cartas) para base de aprendizagem''' PATH_LETTERS = 'resources/letters/' MODE_OPEN =...
asked by 01.11.2017 / 21:45
1
answer

Euro bank sorting program? Python

def Dinheiro_vivo(x): while x > 0.00: if x>=50.0: print( x//50,('notas de 50 euros')) n = x % 50 elif x<50 and x >=20: print (y//20,('notas de 20 euros')) x= x %20 elif x<20 and x >=...
asked by 12.10.2017 / 22:54
1
answer

Search for sequence of disordered words from a list in a text

Is there any way to have an unordered list of words and search for a string of them in a text? Example: lista = ["dia", "noite", "tarde", "é", "está", "bonito", "o", "a", "muito", "feio"] texto = "Hoje é sábado, vamos sair pois o dia está...
asked by 18.10.2017 / 14:30
1
answer

Eliminate code redundancy in a while loop

In this example: . Ask for today's date via a form. . Check if it was typed in dd / mm / yyyy format. . Compare with the current system date from datetime import date def verificacaoData(): dataForm = input('Digite a data atual no pad...
asked by 21.11.2017 / 16:28
2
answers

What is the "self" for? [duplicate]

I'm studying Python to complement my programs on Nodejs. But why in Python, a language that values speed in development and ease in code, is the self used? Very simple self-use example class ButtonPerson(Button, Person): def __init...
asked by 30.08.2017 / 17:54
1
answer

How to turn a .py into an .exe? [duplicate]

I have the following code: #coding-utf-8 from Tkinter import Frame, Tk, BOTH, Text, Menu, END import tkFileDialog from tkinter import filedialog as fd import dbf class Example(Frame): def __init__(self, parent): Frame.__init__(...
asked by 08.11.2016 / 17:54
2
answers

Using For in Python

In Python it is only possible to work with 'for' (loop ) using a list? Is not it possible only with an integer like in other languages?     
asked by 15.11.2016 / 03:17
1
answer

How to set a Tray Icon (tray icon) in a PyQt application?

I'm still new to PyQt and would like to clarify a question: Is there any way to define a Tray Icon in a PyQt application? If so, how can I do it? I need to set some options on this tray icon. Can you do that too?     
asked by 11.11.2016 / 13:04
1
answer

How to take screen screenshot in Python?

I would like to make a program that screens the screen (screen shot) in Python. I found the following code: import pyscreenshot as ImageGrab if __name__ == "__main__": # fullscreen im=ImageGrab.grab() im.show() The code does...
asked by 01.08.2016 / 03:27