skip to Main Content

Json – i have two files ,a text file with a name in it and a j son file with a dataset of names.I'm trying to verify if there is a name inside the text fiie

import json with open('/home/sentry/Documents/mark.txt', 'r') as f1,open('/home/sentry/Downloads/axtscz-english-first-names/Male.json', 'r') as f2: content = f1.read() data = json.load(f2) for p_id in data: name = p_id.get('name') if name in content: # This is where my problem is. print('True') else: print(content) print (name) The…

VIEW QUESTION

Php – JSON sends funny result

I am trying to read this JSON file, which I checked is valid https://www.webminepool.com/api/PK_MgGG3Z8joogwr28PmkE9i/wmc_rate/1000 Here is my code: //normally the rate is changed via PHP $checkbtc = "https://www.webminepool.com/api/PK_MgGG3Z8joogwr28PmkE9i/wmc_rate/1000"; $json = file_get_contents($checkbtc); $json = utf8_encode($json); $json_data = json_decode($json,true); print('<br>...'.$json_data.'...<br>'); var_dump($json_data); The…

VIEW QUESTION

Json – Deserializing private members

I have the following code, taken from https://learn.microsoft.com/En-Us/dotnet/standard/serialization/system-text-json/custom-contracts#example-serialize-private-fields. It works fine to serialize the fields of Brains.Brain, but when deserializing, the instance created has (a, b, c, d) = (2, 0, 4, 4) when it should be (2, 3, 4,…

VIEW QUESTION

convert base64 to json in javaScript

For example, I have a base64 code like this const base64 = "H4sIAAAAAAAEAO2b0W6CMBSGz6MsXm+JUKi6N9gzLLsw4jYTo0bJbpa9+44Ig0J7kBW0PSENNG2B9vtjw09PfYVvmMAGEjw/QwiPmKdYTmEL66xuAics7eGI5QcI4AmPSXbdAZZZ7Q7bX/InBFlLeYdaf37mFx7bSl2C5ROs8OoNPvHc9x6feOk5BAFR3tsK65O/MQmQEGP+g21VAgFzI8O5hx183Gz0zT5VBrW9SbLwkiTQsEQw9ZQl1NKY54nrNJf51CQS7IgidkQxOyLJjmjGjsjP9ylF5Ot71UQUe/x2NREFzIgkO88g2XkGyc4zSHaeQXrqGUTOVD3r+Xx0ECpXF1rKXaj382OnfMi92dX+h1ViZvAvByUtG+lYS+ta2ikpraX7qLnEcgLveX4530Jhyk+V95cjK/N7//76UEylovXTqUd5t1G9NvUonziq16Ye5UlH9drUo/zvqF6bepTXHtWj1Ztf6W3/q16x6nOdfqGH+l3nj0f9TPoNO3sj9vpRX+Kjfu36Detcivg4X/2G9S789Rv2q63YacJXv2G/27jrZ1avupcqJBQKe9WnWBtqcoss8qGPw9lErfodf1+RRZuolZtENlErN4lsolZuEtlErdwksolTuUlks9PFTSKbnS4uEkmrnS5uEtnsdHGRaE4S2fvG/pldco2LgVe9RAf1xA3UW8Entm6zUdS1CHC26+e7mW/R6as2aiXUjVk/UupXH2f7KNvXw6ed1oRi6xkd5f+heINfmSW/7QgyAAA=" Now I want to convert this to json I have tried to convert this base64 to object But I don't know if it's true or not but…

VIEW QUESTION
Back To Top
Search