Skip to content
This repository was archived by the owner on May 23, 2025. It is now read-only.

Commit 40410c1

Browse files
author
River
committed
Fix some data
1 parent 36fc7b6 commit 40410c1

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

INTRO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Python 世界中积累了多年的大部分的类库都能够被快速引入到
3434
安装 QPython 之后,点启动按钮下方的“快速开始“即可看到一个快速开始帮助教程,里面有QPython所支持的3种运行模式:控制台模式,Kivy应用模式以及WebApp模式,在每个例子下油”拷贝到编辑器中运行“,即可将示范代码拷贝到QPython内置的编辑器中,点击编辑器底部的运行符号即可运行。
3535

3636

37-
QPython 于 PC上的Python重合度很高,我们也可以选在在PC上开发调试,随后再上传到QPython的制定目录中。
37+
由于 QPython 就是将Python移植到了Android上,我们也可以选在在PC上开发调试,随后再上传到QPython的制定目录中。
3838

3939

4040
原理

src/assets/test

Whitespace-only changes.

src/main.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@
99
"""
1010

1111
from bottle import Bottle, ServerAdapter
12-
from bottle import run, debug, route, error, static_file, template, redirect, request
12+
from bottle import static_file, template, request
1313

1414
import urllib2
15-
import os
16-
import json
15+
import os,os.path
1716
#### 常量定义 #########
1817
ASSETS = "/assets/"
1918
ROOT = os.path.dirname(os.path.abspath(__file__))
@@ -25,10 +24,12 @@
2524

2625
##################### SL4A ##############
2726
try:
28-
import androidhelper
29-
Droid = androidhelper.Android()
30-
Droid.startLocating()
27+
IS_SL4A = True
28+
#import androidhelper
29+
#Droid = androidhelper.Android()
30+
#Droid.startLocating()
3131
except:
32+
IS_SL4A = False
3233
pass
3334

3435

@@ -67,8 +68,9 @@ def server_static(filepath):
6768
return static_file(filepath, root=ROOT+'/assets')
6869

6970
def home():
70-
location = Droid.getLastKnownLocation().result
71-
location = location.get('network', location.get('gps'))
71+
#if IS_SL4A:
72+
# location = Droid.getLastKnownLocation().result
73+
# location = location.get('network', location.get('gps'))
7274
return template(ROOT+'/index.html', city='北京')
7375

7476
def detail():

0 commit comments

Comments
 (0)