I wanted to take a look at python/pygame today, and downloaded pydev as my IDE.
Pretty satisfied overall, but it seems to be missing autocompletion for the pygame classes.
On the “screen” variable it only lists all the “x” functions, which I guess are the default class object functions.
The pydev folder is added to the PYTHONPATH.
import os, sys
import pygame
from pygame.locals import *
class Main:
background_colour = (255,0,255)
def __init__(self):
pygame.init();
self.screen = pygame.display.set_mode((500, 500));
self.screen.fill(self.background_colour);
pygame.display.flip();
running = True
while running:
self.update();
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
def update(self):
pass
if __name__ == '__main__':
Main()
The code works flawlessy, but ecspecially for a pygame/python noob like myself it is unbearable without any code completion.
The problem is that pydev does not know which type
self.screenis of.One workaround is using a local variable and
assert isinstance(...)to help pydev.