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
Back To Top
Search