trying to strip the "\" cant get the syntax correct

I am getting this error ValueError: Expecting object: line 1 column 2 (char 2)  and after some investigation I think I know why but how to solve it is challenging

when I generate and save my json data it works perfectly
[["Black", 3, [[144, 7, 143, 8], [143, 8, 141, 10], [141, 10, 141, 11], [141, 11, 140, 12], [140, 12, 140, 14], [140, 14, 139, 16], [139, 16, 139, 17], [139, 17, 139, 19], [139, 19, 139, 20], [139, 20, 139, 21], [139, 21, 141, 23], [141, 23, 144, 23], [144, 23, 146, 24], [146, 24, 149, 26], [149, 26, 152, 26], [152, 26, 157, 29], [157, 29, 163, 31], [163, 31, 168, 35], [168, 35, 175, 35], [175, 35, 182, 35], [182, 35, 189, 33], [189, 33, 195, 32], [195, 32, 199, 31], [199, 31, 202, 30], [202, 30, 206, 28], [206, 28, 207, 27], [207, 27, 208, 27], [208, 27, 208, 28], [208, 28, 208, 30], [208, 30, 208, 32], [208, 32, 208, 34], [208, 34, 208, 37], [208, 37, 208, 39], [208, 39, 208, 40], [208, 40, 209, 40], [209, 40, 209, 41], [209, 41, 211, 42], [211, 42, 212, 44], [212, 44, 214, 44], [214, 44, 215, 45], [215, 45, 217, 45], [217, 45, 219, 45], [219, 45, 221, 45], [221, 45, 222, 44], [222, 44, 224, 44], [224, 44, 224, 43], [224, 43, 225, 43], [225, 43, 227, 42], [227, 42, 230, 40], [230, 40, 232, 38], [232, 38, 235, 36], [235, 36, 238, 35], [238, 35, 239, 34], [239, 34, 241, 33], [241, 33, 242, 33], [242, 33, 243, 33], [243, 33, 243, 34], [243, 34, 244, 35], [244, 35, 244, 36], [244, 36, 245, 38]]]

Open in new window


when I POST it to my server and retrieve it later for some reason it adds "/" to the Black
it turns this  ["Black" into [\"Black\"
,
[\"Black\", 3, [[282, 27, 283, 26], [283, 26, 284, 25], [284, 25, 284, 26], [284, 26, 284, 27], [284, 27, 284, 29], [284, 29, 284, 30], [284, 30, 285, 32], [285, 32, 286, 34], [286, 34, 287, 36], [287, 36, 289, 38], [289, 38, 290, 40], [290, 40, 293, 41], [293, 41, 296, 42], [296, 42, 299, 42], [299, 42, 304, 41], [304, 41, 309, 38], [309, 38, 315, 35], [315, 35, 318, 33], [318, 33, 320, 32], [320, 32, 321, 31], [321, 31, 322, 31], [322, 31, 322, 30], [322, 30, 322, 29], [322, 29, 322, 27], [322, 27, 319, 25], [319, 25, 318, 24], [318, 24, 316, 22], [316, 22, 316, 21], [316, 21, 315, 24], [315, 24, 314, 29], [314, 29, 314, 33], [314, 33, 313, 37], [313, 37, 313, 39], [313, 39, 313, 41], [313, 41, 313, 42], [313, 42, 315, 43], [315, 43, 318, 43], [318, 43, 322, 43], [322, 43, 325, 43], [325, 43, 327, 43], [327, 43, 330, 43], [330, 43, 331, 42], [331, 42, 332, 42], [332, 42, 332, 41], [332, 41, 332, 40], [332, 40, 332, 39], [332, 39, 332, 37], [332, 37, 332, 36]]]]

Open in new window


I trying to strip the "\" from black but I cant get the syntax correct

dataform = str(rows[33]).strip('\"Black\').replace('"Black"')
self.wid.SetLinesData(json.loads(dataform))

Open in new window

dolamitejenkinsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

peprCommented:
You should post more infor. There may be a reason for the escaped double quotes. The error can possibly be caused for something else. But it is difficult to tell without more info. Can you attach the exact content before sending it to the server and after retrieving it?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dolamitejenkinsAuthor Commented:
Thanks I attempted to delete this question , You are right the error was actually in the PHP code on the server ... Thank
0
peprCommented:
Thanks for the points, but there is no need to accept everything. ;) You may Request attention of the administrator to get the points back and delete the question. Let this be the proof I agree with that.

Have a nice day.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Python

From novice to tech pro — start learning today.