Hi! I've got this error when i run an working pygame-script:
'bash -c polygott-x11-vnc q && DISPLAY=:0 run-project
nohup: redirecting stderr to stdout'
The code is perfectly working on local python-installation...need help! THX!
screenx = 400
screeny = 300
window = pygame.display.set_mode((screenx,screeny))
counter = 0
run = True
x = 0
y = 0
breite = 0
hoehe = 0
farbe = (0,0,0)
speed = 10
def init(self, x, y, breite, hoehe, farbe):
self.x = x
self.y = y
self.breite = breite
self.hoehe = hoehe
self.farbe = farbe
def zeichneMich(self, fenster):
pygame.draw.rect(fenster, self.farbe, pygame.Rect(self.x,self.y,self.breite,self.hoehe))
def bewege(self, x, y):
self.x += x
self.y += y
viereck1 = Viereck(250,10,40,40,(255,255,255))
viereck2 = Viereck(10,150,20,20,(255,0,255))
#if counter == 100:
run = False
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
keys = pygame.key.get_pressed()
In your repl code, I noticed that you have
keys and the if statements following it wrapped in a set of
''' for some reason. If you remove those
''' from each line, it should run fine.
Hey, just to add something in, I don't believe that what you've said ( bash -c polygott-x11-vnc q && DISPLAY=:0 run-project
nohup: redirecting stderr to stdou ) is an error message. I've also been trying to program with pygame on replit and I see this everytime I run my code, I think it's something it just has to do. Although I've had it freeze at that point quite a lot.
I've been using repl.it to continue programming somewhere else on another system. I have to be awfully careful programming elsewhere other than at home or else I run into the same problem. As you said in a comment, yeah copying code into a new code does seem to work. Other than that, I have to in general program like a perfectionist to avoid this issue: avoid errors, let the program reach the end (add a quick exit button) and not to start and stop the program suddenly.