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

Javascript – Detect the HD image size from the given src and srcset

This is my generated html code with the thumbnail being image-four-300x151.jpg and HD quality being image-four.jpg <figure class="wp-block-gallery has-nested-images columns-default is-cropped lightbox wp-block-gallery-1 is-layout-flex"> <figure class="wp-block-image size-medium"><img decoding="async" loading="lazy" width="300" height="151" data-id="218" src="http://localhost/demo/wp-content/uploads/2023/11/image-four-300x151.jpg" alt="" class="wp-image-218" srcset="http://localhost/demo/wp-content/uploads/2023/11/image-four-300x151.jpg 300w, http://localhost/demo/wp-content/uploads/2023/11/image-four-1024x517.jpg 1024w, http://localhost/demo/wp-content/uploads/2023/11/image-four-768x388.jpg…

VIEW QUESTION
Back To Top
Search