@app.route('/hello', methods = ['GET'])
def api_hello():
with app.open_resource('templates/exercise_data.json') as data:
return data.read(), 200, {"Content-Type": "application/json"}
On Mon, Jul 6, 2015 at 6:20 AM, Sebastian M Cheung <
[email protected]> wrote:
> json_files = [pos_json for pos_json in os.listdir(TEMPLATE_DIRS) if
> pos_json.endswith('a.json')]
>>
>> for js in json_files:
>> with open(os.path.join(TEMPLATE_DIRS, js)) as json_file:
>> # do something with your json; I'll just print
>> print json.load(json_file)
>> # print json.dumps(json_file)
>>
>>
> This will read in json file, but the format is now changed as it attaches
> unicode in front of every object?
>
> [{u'city': u'Westerlo', u'name': u'David XXX', u'country': u'Sp
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "pocoo-libs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/pocoo-libs.
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"pocoo-libs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pocoo-libs.
For more options, visit https://groups.google.com/d/optout.