0% found this document useful (0 votes)
170 views

What Are Some Useful Python Scripts - Quora

This document discusses useful Python scripts and provides an example. It summarizes a Python script that was written to help a friend in a difficult situation. The script crawled doctor reviews online to find a doctor that could discreetly provide an abortion for an unmarried pregnant woman. It extracted reviews from a website, applied keyword filters to find relevant experiences, and generated reports on doctors to help choose one best suited for the sensitive situation. The script demonstrated how Python can be used to create helpful tools to solve real-world problems.

Uploaded by

zach
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
170 views

What Are Some Useful Python Scripts - Quora

This document discusses useful Python scripts and provides an example. It summarizes a Python script that was written to help a friend in a difficult situation. The script crawled doctor reviews online to find a doctor that could discreetly provide an abortion for an unmarried pregnant woman. It extracted reviews from a website, applied keyword filters to find relevant experiences, and generated reports on doctors to help choose one best suited for the sensitive situation. The script demonstrated how Python can be used to create helpful tools to solve real-world problems.

Uploaded by

zach
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

What are some useful Python scripts? - Quora https://www.quora.

com/What-are-some-useful-Python-scripts

Python Scripts Scripting (programming) Learning Python Python (programming language) Related Questions

Learning to Program Programming Languages Web Development Computer Programming


What are the things that I need to learn in Python
to be able to write scripts for downloading stuff?
What are some useful Python scripts?
Is there a way to call a program in Python and not
56 Answers wait for it to end (Python)?

Umang Ahuja, Switch to python if you want fun What can be done with Python?
Answered Jul 24, 2017 · Author has 643 answers and 683.5k answer views
What is Python programming language NOT used
I have recently started writing blog on Quora to share my scripts with fellow Quorans so for?
that we learn together and improve.
What is the importance of the Python language?
Here is the link : Get Set Python
What are the benefits of Python?
The reason for uploading these is that there is no proper resource for scripting which a
newcomer can follow that makes him feel like “Yeah Python is awesome”.

I have written many scripting meanwhile learning Python Scripting which eases the
cumbersome tasks and can prove beneficial for lazy people like me.

I will keep posting my scripts timely. Do follow to stay updated.

Here is a script which I posted recently on my blog.

—————————————————————————————————————

This script test your typing speed.

This is a very beginner friendly script that uses just time module to record start and end time.
So if anyone who want to start scripting, this is just perfect piece of code to get started.

Have a look at the screenshot of this working script.

Code:

1 from time import time


2
3 print()
4 print("NO NEW LINE IS THERE, WRITE CONTINUOUSLY(just SPACES)")
5 s = "this is a simple paragraph that is meant to be nice and" \
6 " easy to type which is why there will be no commas no periods " \
7 "or any capital letters so i guess this means that it cannot really "
8 "be considered a paragraph but just a series of sentences
9 "words = (len(s.split()))
10
11 print()
12 print(s)
13
14 print("\nAfter you are done press enter to know your time and speed")
15 input("\nPress any key to Start:")
16
17 try:

1 of 17 5/6/2020, 11:26 PM
What are some useful Python scripts? - Quora https://www.quora.com/What-are-some-useful-Python-scripts

20 t = input()
21 end = time()
22 if t == s:
23 total = round(end - start, 2)
24 print("\nVoila you typed that correctly")
25 print("Your time was %s seconds" % total)
26 total = int(total) / 60 print("Speed was %s wpm" % (str(words
27
28 else:
29 print("\nWrongly entered")
30 print("Try again")
31
32 except KeyboardInterrupt:
33 print("")

Have fun with Python.

More advanced scripts will be posted soon. Stay tuned.

Hope to see you at my blog.

Here is the link : Get Set Python


15.8k views · View 27 Upvoters

Related Questions More Answers Below

What are the things that I need to learn in Python to be able to write scripts for
downloading stuff?

Is there a way to call a program in Python and not wait for it to end (Python)?

What can't I do with Python?

Why is Python so bad?

How do I write a Python script to run a C program?

Anonymous
Answered Mar 10, 2018

Some might say it is funny or cool, but I would call it one of the most helpful and
interesting scripts I have ever written.

First, I will have to give you some context here. I come from India, and some people here
take it upon themselves to decide what other people should do with their life all in the
name of ”preserving the culture”. So, a few things which are more often taken for granted
in western countries, have a great deal of stigma attached to it here.

One such thing is getting pregnant as an unmarried couple. If at all this happens to you,
may the force be with you! Society will shun you and your partner, and look at you as if
you do not deserve to roam this planet alive. To make this worse, even your parents will
treat you the same as if you have done something that will bring an apocalypse to our
world. They won't care about you or your baby, all they will care about is 'log kya
kahenge?' (what will people say?). Obviously, the couple often tries to find out a way to
discreetly get out of the situation, unless of course, they are ready to fight the society and
keep their "illicit" (sarcasm, just in case people fail to understand. It happens more often
than you think it happens.) baby.

So, one day I was minding my business and eating a burger, my friend calls me and says,
"Bro, I am screwed! I got my girl pregnant!". First, my body goes numb, the second panic
attack starts to set in. There was a pin-drop silence for over a minute on both sides. My
brain had imagined all the probable sh#t that was about to go down in that minute.
Somehow, I calmed myself and asked him to remain calm. I advised him to visit a
gynecologist, the same day. So, he goes to a local gynecologist with his girlfriend, and
here's how it goes down.

Although it is legal to get an abortion in India up to 20 weeks of getting pregnant for both
married and unmarried lady, above mentioned people, "to preserve the culture" choose to
neglect the unmarried ones. Unfortunately, that local gynec was amongst such people.
First, she took all their details, name, phone number address etc, and then slammed them
for being unmarried. She said she does not entertain unmarried couples and shooed them

2 of 17 5/6/2020, 11:26 PM
What are some useful Python scripts? - Quora https://www.quora.com/What-are-some-useful-Python-scripts

It was then understood that visiting random gynecs won't cut it out. So, there is this
startup in India which help people, search doctors according to the services they provide
and book an appointment, all from their website/app. So we searched and found hundreds
of doctors in the area who specialized in MTP. We decided to go check the reviews of
doctors and see if anyone in our situation had opted for MTP and got a positive result.
However, the list of doctors was large and many doctors had thousands of reviews and the
review page showed only a few reviews at a time. It was impossible to go through every
review manually. That is when I had an idea.

I pulled out my laptop and started writing a python web crawler. I somehow managed to
write the script in few hours. The crawler searched the website for the doctors who are
specialized in MTP, in a given list of localities. Then, it hit the patient review API for each
doctor listed in the list and run it in a loop until all reviews were extracted. Then I placed a
keyword filter on the reviews, like 'MTP', 'unmarried', 'scared', etc and the crawler
generated a systematic report for each doctor in an individual file, listing their name,
address, experience, contact, fees and the filtered reviews.

This helped us close in on a perfect doctor and my friend's case was discreetly closed
without any complications. This is the most interesting piece of script I have ever written.
16.7k views · View 24 Upvoters

Dinesh Paliwal, studied at Pursuing B.Tech


Updated Jan 15, 2018

(#1) Renaming files

I am a beginner in Python programming and don’t have much experience with Python. So i
write very small scripts to automate tedious tasks.

The python script I wrote is this:

Whenever i download a video from Youtube through IDM it is saved with a prefix like (12),
(13),(21) [filename] … etc and all i have to do is rename all files manually.

So i wrote a script that rename the files by removing those prefixes.

1 import os
2 for filename in os.listdir("."): #for current directory
3 if filename.startswith("("):
4 os.rename(filename, filename[5:])

Now after downloading videos i execute this script in download directory and all files
renamed automatically.

(#2) Python Script to sort images

Past Story (In short point)

1. I am fond of cool Desktop wallpapers and usually download them from various
websites.

2. One day i was sorting them according to their resolution e.g 4K, 1080p, 720p etc.

3. The collection was huge, around 300+ wallpapers.

4. So it is very tedious and boring to sort them manually so i decided to write a


python script that can automatically compare image resolution and put them

3 of 17 5/6/2020, 11:26 PM
What are some useful Python scripts? - Quora https://www.quora.com/What-are-some-useful-Python-scripts

My wallpaper directory looks like :

The Script part

1 import cv2 #Image processing library


2 import os,glob #For os manipulation
3
4 im_4k = 0 #Initializing counts for each category
5 im_1080 = 0
6 im_720 = 0
7
8 os.system("mkdir 4K") #Creating directories for each type
9 os.system("mkdir 1080p")
10 os.system("mkdir 720p")
11
12 for image in glob.glob('*.jpg'): #Selecting images one by one
13 print(image)
14 img = cv2.imread(image) #Reading image
15 height, width, channel = img.shape #getting image resolution
16 if(width>=3840 and height>=2160): #Comparing image resolutions and moving them acco
17 os.system("move "+image+" 4K")
18 im_4k = im_4k+1
19 continue
20 if(width>=1920 and height>=1080):
21 os.system("move "+image+" 1080p")
22 im_1080 = im_1080+1
23 continue
24 if(width>=1280 and height>=720):
25 os.system("move "+image+" 720p")
26 im_720 = im_720+1
27 continue
28 print(im_4k," 4K images moved to 4K folder") #Printing counts for each type
29 print(im_1080," 1080p images moved to 1080p folder")
30 print(im_720," 720p images moved to 720p folder")

Now all i have to do is just relax and sit back with my coffee cup and my script will create
different directories and move wallpapers to them.

Now my wallpapers directory looks like this:

4 of 17 5/6/2020, 11:26 PM
What are some useful Python scripts? - Quora https://www.quora.com/What-are-some-useful-Python-scripts

Thanks for reading.

Note: I know that this is not a cool scripts they saves me a lot amount of time and i hope
yours will too.

Happy Coding :)

For more exciting stuffs follow my blog : The Nerd Programmer

PS : Hit upvote if you find it helpful


20.5k views · View 231 Upvoters · View Sharers

Achin Sagar, Python , my first programming language


Updated May 30, 2016 · Author has 135 answers and 657.1k answer views

These are the things I have tried out with python.

1. Facebook chat bot :- A bot which says a random Chuck Norris joke to every message in
facebook. I have blogged about it here Achin Sagar's post in Coding experiments .

2.Car racing game control using opencv with python:- Control car on track by detecting
a colored object which is in my case a blue to bottle cap. I have blogged about it here
Achin Sagar's post in Coding experiments .

5 of 17 5/6/2020, 11:26 PM
What are some useful Python scripts? - Quora https://www.quora.com/What-are-some-useful-Python-scripts

3.Play songs or videos from command line from a search query :- This script takes
input from the command line and based on the input it plays a random song or video ,
play a song or video by its name ( The cool thing is the name need not match exactly , a
small algorithm is run to check for similarity between names and plays the best match). I
have blogged it here Achin Sagar's post in Coding experiments .

4.Open firefox , login to fb/twitter and post a status automatically:- I pass my userid
and password to the script and it logs into my account and posts a status automatically. I
have blogged it here Achin Sagar's post in Coding experiments .

5.Script to scrape flipkart to get reviews of a product:- The script makes a request to
flipkart with a search query and scrapes the review data to a list. I have blogged it here
Achin Sagar's post in Coding experiments .

6.Welcome message on windows with text to speech in python :- A script to speak


“Welcome to windows master” in human voice on system bootup. I have blogged it here
Text to speech in python by Achin Sagar on Coding experiments .

PS:- More to come, just started.


11.4k views · View 11 Upvoters

Related Questions More Answers Below

What can I do to make Python programming fun to learn?

What can't I do with Python?

What is python programming language and where uses?

How do I write a python script to check my exam results when uploaded and notify me?

How do I execute Python scripts?

Sabuj Jana, Codeforces Expert | JU IT '22 | Built CPTracker


Answered Sep 16, 2019

I wrote an useful pytho

It will parse all the Cod


date, make separate fo
Continue Reading

6 of 17 5/6/2020, 11:26 PM
What are some useful Python scripts? - Quora https://www.quora.com/What-are-some-useful-Python-scripts

Edit: In the end, I have included a video where I parse last 3 contests of Ashish Gupta a.k.a
Ashishgup.

For a guy like me who likes to keep all my codeforces submissions organised , this script
saves a lot of unnecessary time in organising codes in folders .At last, I can push all my
codes to Github in ...

Dinesh Makkar
Updated Jun 29, 2017

1. I wrote a small python script which helps in increasing my vocabulary. What this
does is, (most of the time I am in terminal in ubuntu) every time I launch a new
terminal, it picks a random word from a dictionary and searches its meaning on
web and displays 2 or 3 definitions of it and synonyms also if available. In
beginning script has small local dictionary from which it randomly selects words.
You can also search a word on your own. (I made an alias “dict” to that python
script so that I don’t have to type whole long path to python script to get the
meaning. ). So I can use directly “user@host$ dict WORD”. As I search a new word
that is not in the local dictionary, script automatically adds this word to local
dictionary so that next time when script randomly picks a word, new word just
now added might also get selected.

2. Similar to previous one, I wrote another python script to display a quote from
local collection of quotes. It randomly selects type of quote (success , educational,
motivational. inspirational and 1 more) and then random selects 1 out of those
approx. 100 quotes of the selected type and displays it on the terminal as I launch
a new terminal. (I again made an alias “quo” to this python script ) which does the
same work. Just type “quo” in the terminal and it shows a quote to make your
day.

Talking about personal experience, I always say to myself that I will read some
new at least 10 words from dictionary or some other source but I have never been
able to learn even 10 words per day. But this script does my work no matter what.

This is what it looks like.

For downloading the script - dineshmakkar079/dictionary

Thanks.
23k views · View 50 Upvoters

Vinay Chandran, Learning to be a snake charmer, just Python though.

N.B

Countdown to Real M Continue Reading

7 of 17 5/6/2020, 11:26 PM
What are some useful Python scripts? - Quora https://www.quora.com/What-are-some-useful-Python-scripts

library to scrape the data from Real Madrid's official website and made a simple
countdown. In a few days I used Python and Flask to make a good looking website that
does the same function. See it here : http://madrid-kickoff.herokuapp.com

See the source here : vinaychandranvs/madridcount...

Amit Bhandari, Writer, mostly like to write codes and stuff


Updated Feb 15, 2018 · Author has 104 answers and 701.3k answer views

This one I made yesterday and could be useful to you if you love changing and putting on
cool desktop wallpapers like me.

I used to search google images -> search for high resolution image -> download and set
as wallpaper. I automated that yesterday.

Script logic is simple as goes like this -

Take search term from user like ‘Batman’

Search google images for ‘Batman HD Desktop Wallpaper’

Include filter for 1920*1080 resolution.

Randomly pick one of the 100 images displayed by google.

Download and set it as wallpaper.

Moreover, I ported script to alternative version where you could download all the 100
photos for given search term at once. Cool, right?

Sounds interesting enough for you? Check out the script here → amit-bhandari/quick-
wallpaper-changer-linux and if someone can, please help porting the script for
Windows as I don’t know how to change wallpaper from cmd in windows.

Some results of running script on my system are.

For search term ‘Avengers’

8 of 17 5/6/2020, 11:26 PM
What are some useful Python scripts? - Quora https://www.quora.com/What-are-some-useful-Python-scripts

‘Aston Martin’

‘Lamborghini’

Let me know in comments what do you guys think about this. Peace out.

—- Long Live Python —-

Edit: Such a good response for relatively such a simple script

Do star and fork it on Github to let more people know about this useful script

Give my android app thumbs up AB Music - Lightweight music player with Lyrics HD -
Android Apps on Google Play on Google play. I am sure you are going to love it.

Edit 2: I have written about cool computer tricks here Amit Bhandari's answer to What are
some good computer tricks that are not commonly known?, check that out as well, they
will be helpful for sure.

9 of 17 5/6/2020, 11:26 PM
What are some useful Python scripts? - Quora https://www.quora.com/What-are-some-useful-Python-scripts

Quora User
Answered Jun 7, 2017 · Upvoted by Ashutoh Purohit, C.Sc Computer Programming & Tavelling,
SRM University, Modinagar (2019)

Update : Answer links updated !

CricBuzz Commentary Reader

Couple of days back I was watching Ind vs Pak (ICC Champions Trophy, 2017 ) which was
interrupted due to rain. I came home early from my college just to see the match. As soon
as I entered my room, rain god decided to obstruct the much anticipated match. After
waiting for the game to resume, I decided to write my own script that fetches commentary
from CricBuzz and reads it. Whenever I am away from my TV i run this script in background

(Source : Google)

To add more fun, i reco


Continue Reading

Gilbert Duy Doan, Intermediate Proficiency


Answered May 1, 2016 · Author has 11.1k answers and 4.7m answer views

When you are serious about the programming language, you have studied the basics.
Some include easy data structures, sufficient algorithms, control flow and looping, data
types, function declaration, class programming, and useful operators. You should just
"know" these elements of the language, and apply them unconsciously. A proficient
enough level in basic programming logically follows to smart use of libraries. Programmers
more experienced than you have developed optimal data structures and algorithms, and
classes for particular use cases. You just need to understand them enough to apply them
correctly. You get bonus points if you know the design and can implement their optimal
solutions.
3.2k views · Answer requested by Pio Leo

Harish Mukkara, Bachelor of Technology from JNTU Pulivendula (2020)


Updated Oct 12, 2017 · Author has 52 answers and 152.9k answer views

Read news while working in terminal


I don’t think this is useful to everyone and many of you might have tried this but I want to
put my script here.
Before getting into code I would like to tell the reason why I did this.

I was new to ubuntu and used to spend most of the time on terminal(practicing
commands) at the same time I was eager to read tech and sports news. but opening and
browsing through websites was killing my time and I could not spending much time
practicing commands.

while thinking about a solution, I came to know about this NEWS API service which
provides simple and easy-to-use API that returns JSON metadata for the headlines currently
published on a range of news sources and blogs.

let’s see how I have solved my little problem.

1 #!/usr/bin/python3
2 import json as js
3 import urllib.request

10 of 17 5/6/2020, 11:26 PM
What are some useful Python scripts? - Quora https://www.quora.com/What-are-some-useful-Python-scripts

6 url=' https://newsapi.org/v1/articles?'+'source='+source+'&sortBy='
7 # print(url)
8 data=urllib.request.urlopen(url).read().decode('utf-8')
9 newsdata = js.loads(data)
10 return newsdata
11
12 def grabSources(language):
13 url=' https://newsapi.org/v1/sources?language='+language
14 rawSource=urllib.request.urlopen(url).read().decode('utf-8')
15 allsources=js.loads(rawSource)
16 sourcesEnlist = [x['id'] for x in allsources['sources']]
17 return sourcesEnlist
18
19 while choice !='0':
20 sources=grabSources('en')
21 print('select a news source you like[using number]')
22 for sno,item in enumerate(sources):
23 print(sno,'->',item)
24 sltsource=int(input('enter your choice:'))
25 newsdata=grabNews(sources[sltsource],'top','PASTE YOUR API KEY HERE')
26 print('--------------------------------------------------------------------------------
27 for news in newsdata['articles']:
28 print(str(news['title']).upper())
29 print(news['description'])
30 print('url-> ',news['url'])
31 print('-----------------------------------------------------------------------------
32 print(' ')
33 choice=str(input('enter "0" to leave news'))

1. save this as news.py

2. open terminal at the same directory where you saved this script and run these
commands one by one

1 chmod -x news.py
2 sudo cp news.py /usr/local/bin/news
3 sudo chmod a+x /usr/local/bin/news

that’s it.

now just type news on your terminal whenever you feel to read news

you will get this

and choose any of 50+ news websites

for example lets take TECH CRUNCH, means i should input 42

now you will get description and link of top news from that website

11 of 17 5/6/2020, 11:26 PM
What are some useful Python scripts? - Quora https://www.quora.com/What-are-some-useful-Python-scripts

footnotes: I know that this isn’t a wise code but this saves me a heck amount of time and i
hope yours will too.

:)
13.5k views · View 32 Upvoters

James Shah, Self Taught Python Developer


Answered Oct 5, 2019

So every time I start a new project, I do the following steps:

1. Create a directory for the project

2. Create and initialize a git repository

3. Push this directory onto git repository

4. Open this project directory in VS Code

And repeating these same steps for every project is boring, so I made a Python and a shell
script that would do all these steps with only one command.

Here is my python script to automate the project initialization process.

1 import sys
2 import os
3 from github import Github
4
5 path = "/path/to/your/desired/projects/directory"
6

Continue Reading

Nitin Vijay, Works at State Bank Of India


Answered Feb 20, 2017

I have written few scripts which can help one explore the capabilities of Python.

1.Convert a video file to audio file in Python.

Just three lines of code.

1 import moviepy.editor as mp
2 video = mp.VideoFileClip("SampleVideo.mp4")
3 video.audio.write_audiofile("SampleAudio.mp3")

2. Mobile Network Operators Plans offered in India:

This script fetches all the mobile network plans of all the operators in all the states in India.
You can compare rates offered by operators across different states from one single csv file.

Continue Reading

12 of 17 5/6/2020, 11:26 PM
What are some useful Python scripts? - Quora https://www.quora.com/What-are-some-useful-Python-scripts

Abhishek Shukla (अिभषे क शु ा), Computer Science Major | Machine Learning


Enthusiast
Updated Jul 22, 2019

Download all your Bookmarked Answers in PDF

Bookmarked Answers is place where we find some of the most interesting answers we
liked on Quora.

Here is a Python script to download all your bookmarked answers in pdf to read them
whenever you like.

1 from selenium import webdriver


2 import time
3 import pyperclip
4 import pdfkit
5 from bs4 import BeautifulSoup
6 from urllib.request import urlopen
7
8
9 brow=webdriver.Chrome()
10 brow.get("https://www.quora.com/bookmarked_answers")
11 wait_inp=input("\n\n\t\tPress Enter after Bookmark page is Fully Loaded\n\n"

Continue Reading

Edwin Lazar
Answered Mar 9, 2017 · Author has 85 answers and 302k answer views

Hi,

Here is a list of useful python scripts .

01_remove_all_pyc.md : remove all .pyc files from a git repo

02_find_all_links.py : get all links from a webpage

03_simple_twitter_manager.py : accessing the Twitter API, example functions

04_rename_with_slice.py : rename group of files, within a single directory, using slice

05_load_json_without_dupes.py : load JSON, convert to dict, raise error if there is a


duplicate key

06_execution_time.py : class used for timing execution of code

07_benchmark_permissions_loading_django.py : benchmark loading of permissions in


Django

08_basic_email_web_c
Continue Reading

Allen Han, studied at University of New South Wales


Answered May 26, 2015 · Upvoted by Quora User, B.Sc. in CS, MS. In NLP.

Here are some functions for my daily use.

1 #-*- coding:utf-8 -*-


2 from functools import wraps
3 import time
4 import pickle
5 import os
7

Continue Reading

13 of 17 5/6/2020, 11:26 PM
What are some useful Python scripts? - Quora https://www.quora.com/What-are-some-useful-Python-scripts

15 with open(fname,'wb') as f:
16 f.write(data)
17 except IOError as e:
18 if e.errno != 2:
19 raise e...

Abhishek Ver, abibliophobic


Answered May 28, 2015

How can I check if my password secure enough?

These are the conditions:

1. Must be at least 8 character long.


2. Must contain at least one digit.
3. Must contain at least one alphabet.
4. Must contain at least one Uppercase
5. Must contain at least one Lowercase
6. Must contain at least one special character among "!@#$%^&*()?".

This could be your answer:

===========================================
password = raw_input('Enter the password ')
special = '!@#$%^&*()
if len(password) >= 8 a
password.isalpha() and
Continue Reading

Aditya Sharma, Beginner myself, beginning to explore Python


Answered May 29, 2016 · Author has 59 answers and 88.7k answer views

Although I am a beginner myself and don’t have much experience with Python, but I’ve
started writing Python scripts and I feel that it’s a great way to learn Python along with
automating tedious tasks. The scripts that I’ve written may not be of that much common
use but they anyway gave me a good start in learning Python.

Some scripts that I’ve written include:

1. A Python script to set a network usage limit and get notified when the
network usage exceeds that limit
Github link: https://github.com/adityashrm21/...

1 #!/usr/bin/env python
2 import os
3 import sys
4 import time

Continue Reading

William Emmanuel Yu, I love learning new programming languages


Answered May 24, 2015 · Author has 5.8k answers and 12.5m answer views

The anaconda installer in Fedora is also a Python script and so is a large number of
administrative utilities.
6.2k views · View 5 Upvoters

Sitaram Devarakonda, Data Scientist at Nete (2018-present)

Split/Merge Any num

Continue only
The couple of online websites I used allowed Reading
2 edits/hour and the other option was to

14 of 17 5/6/2020, 11:26 PM
What are some useful Python scripts? - Quora https://www.quora.com/What-are-some-useful-Python-scripts

file into required number of smaller files.

1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3 """
4 This script is used to split/merge multiple pdf files.
5 python pdf_worker.py -f http://filename1.py -p 1-5 -f http://filename2.py -p 4,5,7 -f htt
6 Files ar...

Ashutosh Tiwari, Student


Updated Mar 19, 2019

I have learnt many things with python! It is like a superpower when you know to code.
Specially in Python!

Using Python, you can automate most of your boring work!

1. I wrote a mini J.A.R.V.I.S with python. Watch the video here -

Features -

Simple conversations.

Solving complex Mathematics problems.

Speech Recognition.

Text-To-Speech.

Playing music.

Getting information from Wikipedia!

Sending emails.

2. I have also written a second version of it with some GUI and named it KAREN.
Check it out -

3. lated names from an


excel sheet and notifie Continue Reading

15 of 17 5/6/2020, 11:26 PM
What are some useful Python scripts? - Quora https://www.quora.com/What-are-some-useful-Python-scripts

Mradul Dubey, Enjoying Python lately


Answered Jul 26, 2016 · Author has 126 answers and 203.7k answer views

Webpage2Kindle
I recently wrote a simple yet useful script for sending Webpages directly to one’s kindle
using a Single Command:

1 ./webpage2kindle 'the_url_of_webpage' 'filename'

One example is in the pic above!

What it basically does is :

Check the url for validity

The webpage is converted into a .pdf file

Send the generated .pdf file to the kindle email associated with your kindle via
your gmail account which is added as trusted device in your amazon kindle
settings, via a smtp gmail server

The script is helpful for


Continue Reading

Ekta Goel, Software Engineer II at Microsoft (2018-present)


Updated Jul 5, 2017 · Author has 160 answers and 243.9k answer views

So, this one's a very basic and an easy one. I had a folder in my system in which files of
multiple types were there (.txt , .mp3). That was much of a mess and thus I decided to
organize them in a way that images are in one folder and songs in one. I started moving
them but I had so many songs and images, moving them individually was a very tedious
job. There it struck me writing this python script which can automatically create a separate
directory/folder and mo

Please note that you ne


Continue Reading

Rene Murray, former Works at Social Mellon


Answered Apr 13, 2020

Update : Answer links updated !

CricBuzz Commentary Reader

Couple of days back I was watching Ind vs Pak (ICC Champions Trophy, 2017 ) which was
interrupted due to rain. I came home early from my college just to see the match. As soon
as I entered my room, r
waiting for the game to
from CricBuzz and read
Continue Reading

16 of 17 5/6/2020, 11:26 PM
What are some useful Python scripts? - Quora https://www.quora.com/What-are-some-useful-Python-scripts

(Source : Google)

To add more fun, i recorded Danny Morisson’s and Harsh Bhogle’s boundary,six and wic...

Related Questions

What are the things that I need to learn in Python to be able to write scripts for
downloading stuff?

Is there a way to call a program in Python and not wait for it to end (Python)?

Is Python a programming language or scripting language?

What are some cool python scripts [Windows/Linux] to minimise daily tasks?

How do I run Python script from php?

How do I learn Python for scripting?

How do I write a Python script to run a C program?

Why is python so widely used?

What can I actually do with Python?

How do I integrate Python script into PHP script?

Where should I write Python code and run it?

Can Python be a substitute for JavaScript (ex. <script type=“text/python”>?

How do I schedule the running of my python scripts?

How do I run a Python script on a startup on Windows?

What does good python code look like?

About · Careers · Privacy · Terms · Contact

17 of 17 5/6/2020, 11:26 PM

You might also like