Discussion:
[bottlepy] Adding Bottle framework in existing python script
Satish Gunjal
2015-10-15 13:58:58 UTC
Permalink
In my python script I am doing bluetooth and RF communication on individual
threads respectively. I want to add Rest Web Method in same script using
Bottle web framework.

If I add below code, in existing python script, it wont work. How to make
it work in existing script.

from bottle import Bottle, run

app = Bottle()
@app.route('/hello')def hello():
return "Hello World!"

run(app, host='localhost', port=8080, debug = True)
--
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.

---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
ia n
2015-11-03 21:40:55 UTC
Permalink
It is a little unclear what you mean by "wont' work"

That code would 'work' in many ways, but obviously not in the way you
wish. But I cannot guess the way you wish from your post.
Post by Satish Gunjal
In my python script I am doing bluetooth and RF communication on
individual threads respectively. I want to add Rest Web Method in same
script using Bottle web framework.
If I add below code, in existing python script, it wont work. How to make
it work in existing script.
from bottle import Bottle, run
app = Bottle()
return "Hello World!"
run(app, host='localhost', port=8080, debug = True)
--
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.

---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Johan Hartzenberg
2016-04-04 10:59:07 UTC
Permalink
Try to connect to http://localhost:8080/hello

I suspect you tried to connect to http://localhost:8080/
Post by Satish Gunjal
In my python script I am doing bluetooth and RF communication on
individual threads respectively. I want to add Rest Web Method in same
script using Bottle web framework.
If I add below code, in existing python script, it wont work. How to make
it work in existing script.
from bottle import Bottle, run
app = Bottle()
return "Hello World!"
run(app, host='localhost', port=8080, debug = True)
--
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.

---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...