I tryed this in IDLE:
IDLE 1.1.1 >>> import pygame >>> pygame.init() (6, 0) >>> screen = pygame.display.set_mode((800,600)) >>> pygame.draw.line(screen, (255,255,255),(0,0),(100,100)) <rect(0, 0, 101, 101)> >>> pygame.display.update() >>> for i in range(100): pygame.display.update()
>>> screen.set_at((50,50),(255,255,255)) >>> pygame.display.update() >>> pygame.quit() >>>
But nothing happend in the pygame window.
To build a console within the pygame window, I know I have to render the text. It's not too slow to render the text if its not a lot text. Anyway thats not my question. I do not know how to build a console within the pygame window. Ok, when the problems of displaying and capturing the text have been solved, what must I do with the strings I get from the "inputbox"? I read something about the eval( ) or the exec( ) functions in the docs but do not understand if they are the functions to pass the strings. The idea is, that on could od the same things as in IDLE console (or as similar as possible). Ok there can be some problems. But such a console would be an interactive interface and the user could do everything (from loading images and display them to apply some transfomation or do whatever with the images). I supose it is possible some how, or not?
Assuming you have a way to display text on the screen, what I'd do is:
input_string = GetInputString() ## Or however you get the string. exec( input_string )
But this method should let you run Python commands.
Kris