Is there a programming language that is combination of Python and Basic?

Ivan Illarionov ivan.illarionov at
Tue Apr 21 12:37:38 CEST 2009

On Apr 18, 3:39 pm, BJörn Lindqvist <bjou... at> wrote:
> I first started programming basic and i don't think it has hurt me much.
> I can somewhat sympathise with the op, neither python nor any other
> mainstream language can still do this:
> PSET 160,100,255

This is not true. It's trivial with pygame or equivalent SDL
bindings in other mainstream languages:
import sys
import pygame

class BasicInterpreter:
    def SCREEN(self, x):
        self.surface = pygame.display.set_mode(
            (320, 200), pygame.FULLSCREEN, 8)

    def PSET(self, x, y, c):
        self.surface.set_at((x, y), c)

if __name__ == '__main__' and len(sys.argv) > 1:
    basic = BASIC()
    with open(sys.argv[1]) as bas:
        for line in bas:
            eval("basic.%s(%s)" % tuple(x.strip() for x in line.split
(' ', 1)))
    while True:
        for event in pygame.event.get():
            if event.type in (pygame.QUIT, pygame.KEYDOWN):


This will execute your BASIC program.


More information about the Python-list mailing list