Questions tagged as 'python-3.x'

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
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

Subtract 2 weeks from a complete date in pyhton

I'm thinking of a date in this format: time.strftime("%d/%m/%Y") // 00/00/0000 I want to subtract two weeks from that date, but I do not know how to do it.     
asked by 20.01.2017 / 18:48
2
answers

How to associate objects to the vertices of a graph?

I am studying about graph theory, more specifically about the vertices that are units representing a given node of a graph. However, there are still some questions about the vertices. See this illustration graph in Python: graph = { 'A'...
asked by 14.08.2018 / 02:02
2
answers

Real-time data reading

I'm trying to make a tool to read and send (real-time) information from a log to my screen. So far I've been able to read everything and send the information line by line and send them all to the screen, follow the code. import time count...
asked by 15.06.2017 / 22:15
1
answer

Why does the input work in Python 3.x and not in 2.7?

I ran this same code with only a few minor differences in syntax to fit the right script mode in Python version 2.7.9 and also in Python 3.4.2 Script that I rode in Python 2: name=input("tell me your name:") print 'Hello',str(name),'!'...
asked by 13.05.2017 / 23:51
2
answers

How to skip the line in writing the files?

Well, basically, I need to skip a line after a certain writing. insira o código aqui print("+---------------------+") print("|DEMONSTRAÇÃO DA LINHA|") print("+---------------------+") print() arqTeste = open("ArquivoTeste.txt", "w") arqTe...
asked by 21.01.2017 / 21:58
1
answer

Have two versions of Python on OSX without overwriting

Is there a way to install Python's 3.x version without overwriting the pre-installed (essential) version of OSX? I already know virtualenv but I'd like to avoid it, because I only use Python to study. Is there any way to keep both versi...
asked by 20.08.2015 / 00:45
1
answer

What is the difference between 'dump' and 'dumps' from the Pickle module in Python?

I've read the Python documentation and also Pickle's own, but I was not able to assimilate the content (lack of examples). On the Web I only found information on how to use dump + load and nothing on dumps + loads     
asked by 15.05.2015 / 01:38
2
answers

What is the difference between forms.Form and forms.ModelForm?

Hello, dear. With the help of a tutorial, I was able to create a template with form and use the forms.ModelForm to save in the database, however, I saw in the Django documentation that there is also the forms.Form. What's the difference? D...
asked by 03.01.2016 / 21:38