Python Forum
How to access py script variables through web app ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to access py script variables through web app ?
#2
You can use flask (http://flask.pocoo.org/docs/0.12/quickstart/)
eg

from flask import Flask, request
app = Flask(__name__)

@app.route('/', methods=['POST', 'GET'])
def test():
    return 'request.args: {} , request.form: {}'.format(request.args ,request.form)

app.run()
request.form contains the POST data

t@tbox:~$ curl -X POST 127.0.0.1:5000?a=b -d 'x=y'
request.args: ImmutableMultiDict([('a', 'b')]) , request.form: ImmutableMultiDict([('x', 'y')])
the "app" can be called from eg apache using a wsgi script
Reply


Messages In This Thread
RE: How to access py script variables through web app ? - by thomasp - Mar-16-2018, 09:43 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Need help for script access via webdriver to an open web page in Firefox Clixmaster 1 1,286 Apr-20-2023, 05:27 PM
Last Post: farshid
  How to access a web service from a python script? dangermaus33 6 3,244 Dec-04-2020, 07:04 AM
Last Post: dangermaus33

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020