2015-01-30 5 views
0

하지 않습니다. 명령을 app.py 파일을 실행하려고는 lpthw.web 설치 한 후에는 그래서, 제 50과 "파이썬 하드 방법을 알아보십시오"하고있는 문제 "처음으로 웹 사이트를 구축"을 통해 갈거야 아무것도

[email protected] (~/Dropbox/Python/gothonweb): ls -R 
bin docs gothonweb templates tests 

./bin: 
app.py 

./docs: 

./gothonweb: 
__init__.py 

./templates: 

./tests: 
__init__.py 

: $ 파이썬 함은 /는 서버를 시작하기로되어 app.py하지만 전혀 아무것도하지 않습니다. 그냥 다시 프롬프트로 돌아갑니다.

#app.py 
import web 

urls = (
    '/', 'index' 
) 

app = web.application(urls, globals()) 

class index: 
    def GET(self): 
     greeting = "Hello world" 
     return greeting 

if __name__ == "__main__": 
    app.run 

먼저 핍을 사용하여 lpthw를 설치했습니다.

$pip install lpthw.web 

내가 나를 ImportError를 준 파일을 실행

: 없음 '웹'은 그래서 내가 http://webpy.org/install 의 도움을 사용하여 그리고 지금은 전혀 결과를 얻기하지있어 자신 webpy 설치 존재한다. Python 2.7.8 : Anaconda 2.1.0을 사용하고있는 Python. 그래서 충돌이 없어야합니다. 어떤 제안? 고맙습니다.

답변

0

그래서, 나는 성공적 그러나 함수 app.ru()

#app.py 
.... 
     greeting = "Hello world" 
     return greeting 

if __name__ == "__main__": 
    app.run 
에 괄호를 추가 고정