2013-10-11 33 views
0

我使用SimpleHTTPServer(文件夾output中調用):SimpleHTTPServer圖

python -m SimpleHTTPServer 8080 

我有以下文件夾結構:

/output/ 
    images/ 
     figure.svg 
    index.html 

index.html(除其他事項外):

<div class="figure align-right"> 
    <object data="images/figure.svg" type="image/svg+xml"></object> 
    <p class="caption">Some caption.</p> 
    <div class="legend">Something</div> 
</div> 

現在我查看index.htmlhttp://127.0.0.1:8080/index.html,並不顯示該圖。爲什麼?服務器找到該文件,因爲它不提供404代碼。

有趣的是,當我在瀏覽器中打開index.html作爲本地文件(不通過http服務器)時,圖像出現。

如果有問題,我正在使用Opera

+0

2分鐘了我:http://gotmetoo.blogspot.fr/2013/07/python-simple-http-server-with -svg.html。可能是你正在尋找的 – njzk2

+0

太棒了!非常感謝! – remus

回答