Skip to main content

Posts

Showing posts with the label Small Programs

Easy Tic-Tc-Toe Game with Command-line UI in Python

Today we will create a very simple Tic-Tac-Toe game, which can be played between two players. The program has a basic input-output command-line process, and displays the game layout after each turn. You need a very simple understanding of Python to get this game off the ground. This game will use a row-column system similar to Chess, which will require the player to input a specific command so that the program marks that particular tile. Don't forget to collect this python file at the end of this post to try it out instantly. So without any further ado, let's start! The Code Starting off, we initialize 3 lists, row1, row2, row3, that represent the 3 rows of the Tic-Tac-Toe game, and each value represents a tile of the game. Initially, the value is kept blank. As the players mark each tile, the values in the lists are updated with values either 'X' or 'O'. Instructions are provided at the start of the game, which clearly states how a player is supposed to input ...

Python Keylogger: Spy Program Made Easy!

Ever wanted to spy on your friend's laptop/computer? Want to get hold of that Netflix password? You are in luck buddy! We present to you, the mighty Keylogger program   using Python .  You may be wondering: What is a Keylogger? And how can I use it to spy on my friends? Here's all you need to know: The Keylogger is a program that runs in the background without interrupting your work, and monitors your keyboard, recording each key stroke (that is, every time you press a key) in a logfile. By accessing this Logfile, you would hit the Jackpot . With this program running on someone's laptop/computer, you can get hold of usernames and passwords that they enter, with the user unaware that the information is being recorded. Beware! Data Theft is a serious offence. We will not take responsibility for any mishap that can be caused by this program. This program is shared solely for the purpose of entertainment. So what are we waiting for? Let's jump right in! And don't forge...

Simple Omegle Bot Using Selenium With Python

Omegle is an online text-based and video-based chatting platform, which allows users from around the world to talk to complete strangers anonymously, for free! The text-based Omegle has a simple concept: Complete a Captcha  verification, connect automatically to a stranger, and after chatting get on to the next stranger. Apart from having a chit-chat with a stranger from the far side of the globe, Omegle poses as the perfect platform for other uses as well. At Omegle, you  can advertise your content, website, products and more for free. With access to about 40,000 strangers using Omegle at any given time, you can benefit if your ideas/advertisement is seen by potential customers. But of course, we can't advertise to each guy we meet again and again. I mean, come on, that's a lot of hard work, even if your message consists of a few words. But worry not, since that's where our Omegle Bot  comes in play. This bot works on a pre-determined set of messages that are to be conve...

Basic Stocks Graph Plotter In Python

  Plotting Graphs in Python Python offers a wide range of graphs that can be plotted using the library  Matplotlib.  We can use the function Pyplot  of Matplotlib to visualize data in many forms like Line charts, Bar charts, Histograms, Pie charts and many more. Today we will make a program to draw Line Charts for our Stock data in Python. This post is in continuation of our previous post where we explained how to collect and store daily stocks data in your database, which you can go over here:  Stock Data Collection in Python . We are going to use the stock data collected from the database we had created there, to get a peek at how a particular stock is performing. Skip to the end if you would like to get the free code! Let's get started! Modules Required As mentioned earlier, we are going to work with matplotlib , specifically with the function matplotlib.pyplot . We will also use mysql.connector to connect Python with MySQL. Last but not the least, mysql.con...

Simple Program for calculating Permutations and Combinations

Permutations and Combinations If you are a 12th grader like me, you would surely agree that the chapter 'Permutations and Combinations' of Mathematics is easily one of the most heinous chapters. It has straightforward formulas for permutations and combinations, but it is the calculation that gets to us. Generally questions from this chapter are pretty easy if you get the logic, but sometimes the expression involves pretty large numbers and it can get messy. Now, that is something your normal calculator can do, can it? So lets leave that for our pet Python. The Code This is a very simple program with just the logic, but I shall explain the code part by part. Skip to the end if you would like to download the python file. No strings attached. Ok, so I'd like the code to run as long as I want in the command prompt. Inputting the expression as exp , we take an empty list to store each digit of the expression so as to seperate the numbers from the letter:      the variable exp_...