hello im very new to python and i want to read some numbers as a vector2 point from a txt file the .TXT file is :
map editor this is line 1
(700, 500)
(100, 500)
(700, 100)
(700, 100)
and the code that is supposed to read it is:
import pygame
import keyboard
pygame.init()
#define a window
window = pygame.display.set_mode((800, 600))
pygame.display.set_caption("Map_editor")
_map = open('Map.txt', 'r+')
_points = _map.readlines()[1:]
print(_points[0])
point1 = _points[0]
point2 = _points[1]
#void update base
run = True
while run:
pygame.time.delay(10)
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
#=====================================================================================================================================================================
#code goes here
pygame.draw.line(window, (0, 255, 100), point1, point2, 10)
#=====================================================================================================================================================================
pygame.display.update()
_map.close()
pygame.quit()
i get this error:File "C:\Users******\Desktop\AGame\Mapeditor.py", line 23, in <module>pygame.draw.line(window, (0, 255, 100), point1, point2, 10)TypeError: invalid start_pos argument
i tried adding int(_points[0]) but it did nothing