Questions tagged as 'python-3.x'

1
answer

What is the difference between classes initialized with (and without) __init

I'm a beginner in Python and wanted to understand a difference. The two classes below produce exactly the same result and the variables are publicly the same in both classes: class c(): t = "abc" print (t) for a in range (3):...
asked by 18.09.2018 / 00:06
2
answers

What is the function of the ismount method

I found some functions of the os module and its submodule path that I am not seeing what they can do: islink ismount Can there be links in the file system?     
asked by 13.10.2014 / 21:42
2
answers

Theoretical question about while and indentation

count = 0 while (count < 10): # Ponto A print ("Olá...", count) count = count + 1 # Ponto B # Ponto C Why    count < 10 is always true at point B. is not true if "Point B" belongs to the same indentation of "Point...
asked by 09.06.2017 / 14:27
2
answers

Sort algorithm is not working!

"" " Sort the elements of a list in ascending order "" " #ordenação bolha #L = [5,3,1,2,4] L = [7,4,3,12,8] x = 0 while x < (len(L) -1): if L[x] > L[x+1]: L[x],L[x+1] = L[x+1],L[x] x += 1 print(L) Output: [4, 3, 7, 8, 12]...
asked by 25.03.2018 / 19:24
2
answers

Replace all characters in a string with another character

def getGuessedWord(secretWord, lettersGuessed): secretWord_copy = "" for i in secretWord: print(i) secretWord_copy = secretWord.replace(i," _ ") print(secretWord_copy) secretWord = 'apple' I'm trying to replace ev...
asked by 22.04.2018 / 21:04
1
answer

Program to convert mp3 using multiprocessing module is looping

import subprocess from multiprocessing import Process, Lock def ConverteMusica(a,lock): input_file_fmt = '{}.mp3' output_file_fmt = a for x in range(1, 5): subprocess.call(['ffmpeg', '-i',...
asked by 10.04.2018 / 14:43
1
answer

Installer recognized as virus

Hello, I created a program in python 3.6 and created its executable for Windows with Cx Freeze, then created an installer for it using Inno Setup 5.6. When I shared with my friends for them to test, windows prevented the installer from opening,...
asked by 06.07.2017 / 13:52
2
answers

Get Data in JSON structure with python

I want to access certain information in the JSON code below, with python: { "informacao1": valor_informação1, "informacao2": "{ dado=informação_dado }" print(arquivojson.get("informacao1")) The above print will display the line bel...
asked by 21.05.2017 / 16:42
2
answers

Regex to get text into python?

I would like to extract the text contained between < > of a string. At first, I built the following expression: import re m=re.search(r'<(.*)>','abevbv envvrhwkv <eiwbv> ebvi <wieunv> ajhbsvhj') The expression would...
asked by 30.04.2017 / 19:10
2
answers

How do I check if it is uppercase, lowercase, or mixed with upper case?

print('-----') print('TESTE') print('-----') print() lista = ['Joao', 'Joaozinho', 'Rafael'] print(lista) var = str(input('Digite algum dos nomes da lista:')) if var == 'Joao' or var == 'João' or var == 'joao' o...
asked by 25.02.2017 / 02:02