Alexandre B A Villares 🐍 on Nostr: Seems OK to me... #Python with open(text_file) as f: items = [line for line in ...
Seems OK to me... #Python
with open(text_file) as f:
items = [line for line in f.read().splitlines()
if line.strip() and not line.startswith('#')]
Context: A txt file with a list of files to process, some are commented out, and there is a first line head comment followed by a blank line.
Published at
2024-03-12 14:50:16Event JSON
{
"id": "278ce8e072e0679d1d85edcbf2db44a5b09ac9ed89cac4d7292d239e062300ee",
"pubkey": "883b5e42e69fa4eb2bee76e555c217028b48dc7676f61453c7f506fd1a33ab62",
"created_at": 1710255016,
"kind": 1,
"tags": [
[
"t",
"python"
],
[
"proxy",
"https://ciberlandia.pt/users/villares/statuses/112083272741290780",
"activitypub"
]
],
"content": "Seems OK to me... #Python \n\nwith open(text_file) as f:\n items = [line for line in f.read().splitlines()\n if line.strip() and not line.startswith('#')]\n\n\nContext: A txt file with a list of files to process, some are commented out, and there is a first line head comment followed by a blank line.",
"sig": "569784c5a345c051f83d46bb4c2259bc9b609194e8b2ddcc58ec4993563a7b67356493bf64d586f6038968facf5bde0d984b5cf70f5d5b540a9e5c95ff3a88e9"
}