用virtualenv venv搭建python虚拟环境。然后执行。
#!/usr/bin/env python
from flask import Flask, render_template, request
app = Flask(__name__)
@app.route('/getOp/')
def search():
# arguments
ip = request.args.get('ip')
result = iplib_querier.query_ip(ipstr);
return 'ip loc is: {}'.format(result)
if __name__ == '__main__':
app.run(debug=True, host='192.168.43.6', port=8081)