[Solved] x.split has no effect


It’s a dictonary, not a list of strings.
I think this is what you’re looking for:

data = str({"state":1,"endTime":1518852709307,"fileSize":000000}) #add a str() here
data = data.strip('{}')
data = data.split(',')
for x in data:
   x=x.split(':')[-1] # set x to x.split(...)
   print(x)

The script below prints out:

 1
 1518852709307
 0

Here is a one-liner version:

print (list(map(lambda x:x[1],data.items())))

Prints out:

[1, 1518852709307, 0]

Which is a list of integers.

solved x.split has no effect