我在做什么错我的代码?
问题描述:
当试图在线运行Cloud 9 IDE的代码时,它不会运行并生成在终端中看到的错误代码。我需要做什么。它提到了一些关于更改主机名的内容?但我不知道该怎么做。我在做什么错我的代码?
另外这里的实际代码:
import os
import pygame
import sys
from pygame.locals import *
pygame.init()
white = (255,255,255)
black = (0,0,0)
red = (255,0,0)
green = (0,255,0)
blue = (0,0,255)
setDisplay = pygame.display.set_mode((400,300))
pygame.display.set_caption("Hello World")
singlePixil = pygame.PixelArray(setDisplay)
singlePixil [3] [3] = yellow
和终端输出...
Your code is running at https://pygame-fidelwillis.c9users.io.
Important: use os.getenv(PORT, 8080) as the port and os.getenv(IP, 0.0.0.0) as the host in your scripts!
Process exited with code: 1
答
我看到两件事情正在进行。一个可能并不重要。
目前的问题是,bash脚本踢了跑步是有问题的。没有看到它,我不能说太多。但它是围绕变量集或导出引发错误。
在代码本身中,在使用它之前我没有看到“黄色”的定义,所以我期望它会在出现这种情况时出错。
我猜你的互联网浏览器不能启动pygame,因为它需要启动一个外部应用程序,但它由一些服务器运行,不能将应用程序流式传输到您的计算机。 –