Let's say I have a text file where its configuration is:
1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-18-19-20...-999
How do I read the file and save each number of the one that is separated by - ?
I wanted people to access my URL as usual before (to install channels) localhost/home/minha-slug and to detect socket messages within that route. I want to create Groups not to be sending messages to all of the site, but who is on the pag...
I'm trying to send an image from the 'dir' directory to another client in my network. Sockets are working properly, the image arrives at the destination and is saved, but when I try to open it I get: "This is not a valid bitmap file."
#Cód...
I was normally using Firefox in Selenium with Python, but wanted to do some testing using Google Chrome, so I made the following change:
self.driver = webdriver.Firefox()
To
self.driver = webdriver.Chrome()
It opens Google Chrome but s...
I have a text file (attachment.txt), which I have to store in a dictionary, with Name as key and phone, value. the file has the following information:
--- nome telefone ---
Ailton-1197765445 Josefa-2178655434
I used the following code:
re...
I have a class button that is a sprite and has a text attribute that is also a sprite. I wanted to know how to change the position of the text when I change the position of the button rect?
import pygame
class Botao(pygame.sprite.Sprite):...
"Make a program that, when you populate a list with 8 integers, store it in a growing fashion. Display the resulting list each time a value is stored"
lista = []
for x in range(8):
n = int(input("Digite um número inteiro: "))
inseriu...
def busca(num, a, primeiro, ultimo):
meio = int((primeiro + ultimo) / 2)
if num == a[meio]:
return meio
elif num < a[meio]:
return busca(num, a, primeiro, meio)
else:
return busca(num, a, meio+1, ultimo)...
I have a script here that looks for all the .txt files in a folder and then joins them into one file.
The problem is that some files have a "\ n" in the last line, causing the next line not to be below the previous one, causing errors when I...