First Post

10 views
Skip to first unread message

Michael S

unread,
Feb 7, 2026, 4:53:29 PMFeb 7
to compilepython
Obligatory first post - testing that this works.

Michael S

unread,
Feb 18, 2026, 11:43:40 AM (4 days ago) Feb 18
to compilepython
Test c/p of python code from github  

import pygame, pygame.camera, time
from guild.actor import *
pygame.camera.init()

class Camera(Actor):
   def main(self):
       camera = pygame.camera.Camera(pygame.camera.list_cameras()[0])
       camera.start()
       while True:
           yield 1
           frame = camera.get_image()
           self.output(frame)
           time.sleep(1.0/50)

class Display(Actor):
   def __init__(self, size):
       super(Display, self).__init__()
       self.size = size

   def process_start(self):
       self.display = pygame.display.set_mode(self.size)

   @actor_method
   def show(self, frame):
       self.display.blit(frame, (0,0))
       pygame.display.flip()

   input = show

camera = Camera().go()
display = Display( (800,600) ).go()
pipeline(camera, display)
time.sleep(30)
stop(camera, display)
wait_for(camera, display)


Test c/p of python code from an editor:

import pygame, pygame.camera, time
from guild.actor import *
pygame.camera.init()

class Camera(Actor):
    def main(self):
        camera = pygame.camera.Camera(pygame.camera.list_cameras()[0])
        camera.start()
        while True:
            yield 1
            frame = camera.get_image()
            self.output(frame)
            time.sleep(1.0/50)

class Display(Actor):
    def __init__(self, size):
        super(Display, self).__init__()
        self.size = size

    def process_start(self):
        self.display = pygame.display.set_mode(self.size)

    @actor_method
    def show(self, frame):
        self.display.blit(frame, (0,0))
        pygame.display.flip()

    input = show

camera = Camera().go()
display = Display( (800,600) ).go()
pipeline(camera, display)
time.sleep(30)
stop(camera, display)
wait_for(camera, display)

Michael

Michael S

unread,
Feb 18, 2026, 11:48:50 AM (4 days ago) Feb 18
to compilepython
Copy and paste from from github doesn't seem to retain formatting unless you bounce through something like google docs first, but if you do that it does retain the formatting. Presumably an odd copy/paste buffer thing:
Reply all
Reply to author
Forward
0 new messages