Tagged Questions
0
votes
1answer
36 views
Trying to extract json data, geting expected string or buffer
So I'm experimenting with json abit and this is the code I've got this far,
import json
from utorrent.client import UTorrentClient
uTorrent = UTorrentClient("xxxx", "xxxx", "xxxx")
data = ...
1
vote
2answers
29 views
json and encode strings
I have this list of strings..
list = [u"čeština", u"maďarština", u"francouština"]
I need to dump it into a file, I am using JSON for that
text = json.dumps(list)
FILE = open("file.txt", 'w')
...
0
votes
2answers
13 views
Building a GeoJSON with python
I want to generate dinamically a geoJSON with a variable number of polygons. Example for 2 polygons:
{
"type": "FeatureCollection",
"features": [
...
0
votes
1answer
25 views
Unicode Decode Error for JSON in python
I am trying to send a GET request to a URL that I know returns data in the form of JSON using python. However, I keep getting a Unicode Decode Error on line 21:
Traceback (most recent call last):
...
0
votes
0answers
20 views
Flask Display Json in a Neat Way
I'm creating an API from a mongodb database using Flask and have the following code:
app.route('/<major>/')
def major_res(major):
course_list = list(client.db.course_col.find( {"major" : ...
2
votes
2answers
24 views
Printed python JSON back into python
So, I had someone send me a JSON dump of some data, but they obviously did it lazily (by printing) in python so that the (simplified) data is:
{u'x': u'somevalue', u'y': u'someothervalue'}
instead ...
1
vote
1answer
26 views
Robust json parser in Python or Java
I'm looking for a robust json parser in either Python or Java (so far, I've been working with Python, but as I'm using it to analyze a Java benchmark, using Java is a reasonable alternative.)
Robust ...
0
votes
1answer
17 views
list index out of range querying UV index from device
Im new to python and playing with my raspberry-pi to pull some data out of my homewizard device.
I want to receive the UV index with json from the device using this python script.
My goal is to query ...
2
votes
2answers
47 views
Parsing JSON responses
Im using the python module 'requests' to send a RESTful GET to a server. For which I get a response of a JSON response. The JSON response is basically just a list of lists.
Whats the best way to get ...
-2
votes
2answers
26 views
Error decoding mixed encoding JSON string
I have trouble parsing a dict with a list that contains both ascii and unicode. This is my pretty string:
pretty_string = """{
"list": [
"this_keyword_in_ascii",
...
0
votes
1answer
49 views
Escape backslash in JSON encoding python
I m trying to JSON encode the following dict. But in this case, the message which is actually a unicode character DEVANAGARI LETTER.
So, while encoding this dict into a json object, it seems to ...
0
votes
1answer
51 views
Python Validictory (JSON schema validation): How to OR multiple schemas?
I have multiple schemas, each one for data sub-type:
type_one = {
"type": "object",
"properties": {
"one": "string"
}
}
type_two = {
"type": "object",
"properties": {
"one": ...
0
votes
2answers
28 views
Why does this python procedure not produce an output after I have parsed the JSON file?
Using this json data I parsed the information correctly but after assigning the parsed data to a variable and running it through the procedure I dont get an output, why?
{"maps":[{"id":"blabla i am ...
-3
votes
0answers
42 views
python generating json has error in for loop “too many values” [duplicate]
I'm experiencing the too many values error with this simple peice of code and can't figure out what the issue is:
The error comes from the for loop which.
I've gotten a message saying this has been ...
2
votes
2answers
32 views
Finding the shortest path in a complex data structure with looping nodes
Here is an example of the data structure I have stored in JSON:
{
"alpha": {
"node1": "echo",
"node2": "bravo"
},
"bravo": {
"node1": "alpha",
"node2": ...