[TOC]

QPython header
--------------
QPython script's header can control some behavior, it will run with GUI mode ( You can see the output by click the notification bar's icon ) by default.  

## User mode

- Run with console mode ( Default mode, the same behavior as desktop or server computer's python ) 
```
#qpy:console
val = raw_input("Please input value")
print "hello world %s" % val
```

- Run with kivi mode ( Graph mode )
```
#qpy:kivy
...
```


- Run with web app mode
```
#qpy:webapp:<app title>
#qpy:fullscreen
#qpy://localhost:8080
"""
Launching the web service on localhost:8080 without android titlebar (fullscreen)
"""
```

## python core

- Run with python 2 runtime ( In Development )
```
#qpy:2
print "This is python 2 syntax"
```
- Run with python 3 runtime ( In Development )
```
#qpy:3
print("This is python 3 syntax")
```



SL4A Programming
--------------------
QPython has extended [SL4A](http://wiki.qpython.org/en/sl4a), which let your android device works by script driving.


WEB Programming
---------------
QPython include [Bottle](http://bottlepy.org/docs/0.12/) and [django framework](http://djangoproject.com) as it's WEB framework. You can install it from QPypi, when you have installed django in your android, you can make HTML apps with powerful python backend easily.  

Advanced Network Programming
--------------------
Besides the python's basic network APIs, QPython supports the [Twisted framework](https://twistedmatrix.com/trac/), which could work with kivy as well in QPython.

Other libraries
---------------
There are many libraries you can find it from [QPypi](http://packages.qpython.org), you can enter the QPypi from QPython to install them.