2016-06-09 113 views
-2

當試圖在線運行Cloud 9 IDE的代碼時,它不會運行並生成在終端中看到的錯誤代碼。我需要做什麼。它提到了一些關於更改主機名的內容?但我不知道該怎麼做。我在做什麼錯我的代碼?

The Image Of The Code

另外這裏的實際代碼:

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 
+0

我猜你的互聯網瀏覽器不能啓動pygame,因爲它需要啓動一個外部應用程序,但它由一些服務器運行,不能將應用程序流式傳輸到您的計算機。 –

回答

0

我看到兩件事情正在進行。一個可能並不重要。

目前的問題是,bash腳本踢了跑步是有問題的。沒有看到它,我不能說太多。但它是圍繞變量集或導出引發錯誤。

在代碼本身中,在使用它之前我沒有看到「黃色」的定義,所以我期望它會在出現這種情況時出錯。