10 Interesting Things You can Do with Python…

Ali Hyder
7 min readApr 28, 2022

--

Photo by Timothy Dykes on Unsplash

You’ll find many different articles on how python is being used right now in the real world. Lots of projects, and lot’s of smart people that use Python to do a bunch of crazy cool things. But what if you don’t want to know what they’re doing with Python? What if you want to know what you could do with Python?

Python is a versatile programming language that can be used for a wide range of applications. In this blog, you will learn 10 different amazing things you can do with python.

1. Crawl a Website

Photo by Ivan Ivanovič on Unsplash

You can crawl a website to extract data. But what does that mean, and why would you want to do it?

When you crawl a website, you’re essentially telling the browser programmatically what URLs to visit and what actions to perform on those pages. The data is then structured according to your specifications, and can be displayed in any way you like. For instance, if you wanted to get the number of comments per blog post on reddit’s r/python channel, you could write a Python script that crawls through each post’s comments section and returns a list of numbers for each comment thread.

2. Build a Website

Photo by Faisal on Unsplash

You want to build a website. Python is certainly one of the best back-end programming languages to use. You can use Django or Flask for web development in Python. They are two very popular frameworks for web development.

Many websites like YouTube, Reddit, Quora etc. were built using Python programming language. You cannot only build a website but also automate your daily tasks with the help of python modules like Selenium and Beautiful Soup.

3. Build a Game

Photo by Markus Spiske on Unsplash

You can build a game with Pygame. Pygame is a module that provides you with the ability to create games using Python. The Pygame module is full of different functions and classes that allow you to do things like play sounds, draw pictures on the screen, etc. It’s best to check out the documentation for Pygame if you’re interested in this one — there’s nothing more boring than reading about how awesome it is to play games in my opinion! I’ve personally never done this but I’m sure many people would love it — especially those who are into gaming themselves (as well as programmers).

4. Write an Automated Script

Photo by Sai Kiran Anagani on Unsplash

However, if you want to use Python to automate things, the sky is the limit. With the right packages and libraries, you can write an automated script that would send emails on your behalf, update spreadsheets with data from another source (or multiple sources), browse the web (with Selenium), or even enter filler data into a database every time a form is filled in incorrectly.

5. Decrypt a Code

Photo by Markus Spiske on Unsplash

As you may know, cryptography is an encryption process to make a message unreadable by anyone except the intended recipient. This process is commonly used by governments and militaries to communicate sensitive information, but it also has other applications, such as ensuring privacy during online communication. Cryptography can be done in a number of ways, one of which is through the Caesar Cipher. This cipher involves shifting every letter in a message up or down the alphabet by a certain number (the key). The letter ‘a’ would become ‘b’ if shifted one place to the right, ‘z’ would become ‘a’ if shifted left and so on. If you wanted to send someone the plaintext “hello world” using this cipher with 1 as your key, you’d get “ifmmp xpsme”. Of course this isn’t foolproof since people can crack codes if they have enough time on their hands — when breaking codes it’s common for people to try all 25 shifts (e.g., shifting ‘A’ 25 times would bring you back around to ‘A’).

With Python, it’s easy for us to see why this is not very secure! And we’re going to do exactly that using writing code that uses a dictionary with letters of alphabet as keys and numbers 0–25 representing how many places each letter should shift — we’ll call this our key!

6. Scrape data off the Internet

Photo by Firmbee.com on Unsplash

You can use Python to scrape data off the Internet if you know how. Scraping websites is known as web scraping, and it’s a way to extract data from websites by downloading and analyzing the HTML code that makes up the website. There are many types of interesting data in web pages, including text, links, images and more.

For example, if you wanted to get a list of NBA players from Wikipedia, you could write a program to scrape that data from the site automatically! Now let’s say your favorite basketball player recently got traded. You could make your scraper run every day so it detects when that new team gets added to their Wikipedia page, then have it alert you by email or text message automatically. This is just one example but there are thousands of opportunities for web scraping.

Web scraping can be used for good or evil! It’s important to make sure that any data scraped is legal under the Fair Use doctrine: http://fairuse.stanford.edu/overview/fair-use/what-is-fair-use/

Also remember that copying whole websites with all their content using this technique might not be cool with those sites’ owners or legal under copyright law: https://www.copyright.gov/title17/#ch1

7. Create your own command line interpreter

Photo by Gabriel Heinzer on Unsplash

You can create your own command line interpreter with the argparse library.

A command line interpreter is a program that you type commands into and it will perform those commands. You’ve probably seen some of these, such as “ls” or “rm” or “mkdir”. If you have Python installed, then you have IDLE, which is an interactive command-line interpreter that lets you type in Python code and execute it.

What Python’s argparse library allows you to do is to write your own custom command line interpreters. This can be useful for automating tasks by typing in a bunch of commands and then just running them from the command line, so that instead of typing them out every time, all you have to do is just run the script.

8. Decode a captcha

You can use Python to decode a captcha.

A captcha is a type of challenge-response test used in computing to determine whether or not the user is human. Decoding captchas can be useful for various reasons. For example, if you are a student and trying to access an article that requires payment and the site has a free trial period, you can use your writing skills to bypass this limitation while maintaining the integrity of the website’s security by not cracking codes that could potentially allow artificial intelligence or robots access to content meant for humans only.

Python offers many ways to accomplish this task but one of the most common methods uses Tesseract. Tesseract is a popular Python package used to decode captchas, so it’s easy enough for anyone who knows how to write code in Python or C++ (or any other language) and has basic knowledge about computer vision algorithms such as convolutional neural networks (CNNs).

9. Develop a GUI app

Photo by charlesdeluvio on Unsplash

Python is not used in a web browser. It is used on the server-side. But you can make desktop apps with Python. To make a desktop app, you will need a GUI library such as Qt or Tkinter or Kivy. You have to install these libraries separately. Kivy is used for cross-platform applications, so you would use that if you wanted an app that ran on Android phones, iPhones, tablets, PCs and other platforms.

Tkinter is built into Python (not in our Workspaces) and so no installation is required; it provides a simple GUI and easy to learn for new programmers

10. Create an artificial intelligence program

Photo by Markus Winkler on Unsplash

Python is a versatile and user-friendly programming language. It’s also a powerful tool that can be used to do many things. One of the things you can do with Python is develop an artificial intelligence program. Here are some steps you could take if you were interested in doing that:

  • Get your hands on some data (this might depend on what kind of AI program you want to create)
  • Gather training materials for your AI program
  • Annotate your training data (you’ll want to categorize it so the AI program knows how to interpret it)
  • Start coding!

Python is really interesting and useful!

Python is a really interesting and useful tool. There are many things you can do with python and it can be used for work or fun.

This blog listed 10 things that you can do with python. You could use this list to learn some of the uses of python if you don’t know. You could also use this list to share what you learned about python with someone else!

--

--