Scripting

This blog post is about some scripts, that I have been writing for tasks that can be easily automated.

This gives the meaning of a word with example sentences. This script would let the user learn a word a day. This one would download a Youtube video for you will also fetch information about that video.

This script pretty prints JSON like below

 {"COLUMNS":["ID","TITLE","POSTED"],"DATA":[["905D9689-0130-1A16-62272F586A771C0C","mmm","May, 15 2007 10:31:00"],["905DAAED-E300-3B9D-7E25E43985CA9507","nn","May, 15 2007 10:31:00"],["905DE931-B8DB-B1AD-F77FC505851C2E9A","j","May, 15 2007 10:31:00"],["905E0C6A-99B8-97EC-4862D9064B9EC659","mmmmm","May, 15 2007 10:31:00"],["905E5910-0E2D-C566-5DCD39E6FD48ED06","NUMBER 11","May, 15 2007 10:32:00"]]} 

to


{
"DATA": [
[
"905D9689-0130-1A16-62272F586A771C0C",
"mmm",
"May, 15 2007 10:31:00"
],
[
"905DAAED-E300-3B9D-7E25E43985CA9507",
"nn",
"May, 15 2007 10:31:00"
],
[
"905DE931-B8DB-B1AD-F77FC505851C2E9A",
"j",
"May, 15 2007 10:31:00"
],
[
"905E0C6A-99B8-97EC-4862D9064B9EC659",
"mmmmm",
"May, 15 2007 10:31:00"
],
[
"905E5910-0E2D-C566-5DCD39E6FD48ED06",
"NUMBER 11",
"May, 15 2007 10:32:00"
]
],
"COLUMNS": [
"ID",
"TITLE",
"POSTED"
]
}

using

python PrettyPrintJSON.py inputfile.txt outputfile.txt

You can use this or this to pretty print un indented HTML files.

This script will allow you to enter the commit message without doing below all over again.

git add -A
git commit -m 'Your Message'
git push origin master

This script fetches the current location of the user and outputs the weather. This script can locate the user.

More.

#code, #programming, #python, #scripts