cwadayi commited on
Commit
c2414c2
·
verified ·
1 Parent(s): 8ca0972

Update tutorial_advanced.py

Browse files
Files changed (1) hide show
  1. tutorial_advanced.py +6 -3
tutorial_advanced.py CHANGED
@@ -43,12 +43,15 @@ def fetch_and_plot_events(min_mag, days_ago):
43
  else:
44
  color = "red"
45
 
46
- popup_html = f\"\"\"
 
 
 
47
  <b>時間:</b> {origin.time.strftime('%Y-%m-%d %H:%M:%S')}<br>
48
  <b>規模 (M):</b> {mag:.1f}<br>
49
  <b>深度 (km):</b> {depth_km:.1f}<br>
50
  <b>位置:</b> ({lat:.2f}, {lon:.2f})
51
- \"\"\"
52
 
53
  folium.CircleMarker(
54
  location=[lat, lon],
@@ -99,6 +102,6 @@ with gr.Blocks(title="進階地震地圖") as demo:
99
  outputs=map_output
100
  )
101
 
102
- # 4. 啟動 App ( [修改] 只有在直接執行此檔案時才啟動 )
103
  if __name__ == "__main__":
104
  demo.launch()
 
43
  else:
44
  color = "red"
45
 
46
+ # [***** 修復 *****]
47
+ # 移除了 f 後面的反斜線 \
48
+ # 並修正了結尾的 \"\"\"
49
+ popup_html = f"""
50
  <b>時間:</b> {origin.time.strftime('%Y-%m-%d %H:%M:%S')}<br>
51
  <b>規模 (M):</b> {mag:.1f}<br>
52
  <b>深度 (km):</b> {depth_km:.1f}<br>
53
  <b>位置:</b> ({lat:.2f}, {lon:.2f})
54
+ """
55
 
56
  folium.CircleMarker(
57
  location=[lat, lon],
 
102
  outputs=map_output
103
  )
104
 
105
+ # 4. 啟動 App ( 只有在直接執行此檔案時才啟動 )
106
  if __name__ == "__main__":
107
  demo.launch()