Posts

Showing posts from October, 2022

Make image resizer with python in 75 seconds

This blog presents the description of the video I uploaded on YouTube. Video link: https://youtu.be/o6YzM0OKzMo To make the image resizer, you need to first open visual studio or PyCharm. Then in the terminal, write (pip install PILLOW) PILLOW is the library for python image frameworks. After installation is complete, copy and paste this code within the IDE and run the code. from PIL import Image from math import floor myImgPath = input ( 'Image path: ' ) percentage = int ( input ( 'Resize percentage: ' )) def resizeImg ( img , percentage = 100 ):     myImg = Image . open ( img )     sizedImg = myImg . resize ( size = [ int ( myImg . size [ 0 ]*( percentage / 100 )), int ( myImg . size [ 1 ]*( percentage / 100 ))])     return sizedImg resizeImg ( myImgPath , percentage ). show () This code takes image path as an input and shows the resized image automatically.

Get area of circle using Python

  # Get the area of a circle using Python circleDiameter = 8 #in centimeter #we know the formula for area of circle is 2 x pi x radius #pi formula is not a builtin function for python # I need to use the math library from math import pi circleArea = pi * (( circleDiameter / 2 )** 2 ) print ( circleArea )

Simplest offline keylogger with Python

Image
  Note : This software is a offline software for data backup purpose. What this software does : Open the software by clicking on the keyLogger.exe file A simple loading icon with the cursor will show up for 3 - 4 seconds. After the loading icon is gone, it means the software is running in background. No window will load. While the software is running, whenever a type something with a keyboard, every keypresses will be recorded into a keyLogger.txt file. Space, Backspace, Ctrl etc functional buttons will be written like {{space}} {{backspace}} {{ctrl}} like this. To close the software, you need to hold and release [ CTRL + SHIFT + 0 ] together. Note: the 0 is ' number zero ' You can also close the software from Task Manager   I am selling this software source code and the software both for only $10.00 Comment below if you want to buy one!

Creating my first website with python - SGATE

 I will print all the status 

Get RGB value of each pixel from an Image in Python (The easiest way)

I used this library: PILLOW To install the library, just type >>> pip install PILLOW <<<   in the terminal. Use this code to print each pixel's RGB value in console: from PIL import Image with Image.open( "testBitmap.jpg" ) as im: px = im.load() for i in range ( 612 ): for j in range ( 612 ): print (px[i , j])

Learning MySQL - What is it?

Upcoming tutorials - (Extra post!)

 Modules - separate file like our own library in Python #45 __name__ Class - call it with object.functionName() / classname.functionName(object) Inheritance - get all functions from other class to a class   File - #65 Comment (#), (""")

Learning Python - 7th Day (Night - 2)

 Watched this tutorial: Click here First of all I have learnt about filter function here. To understand this I thought about a list. Lets say I have a list of fruits. Banana, Apple, Black, Avocado, Blueberry Now I want every single name of the fruit list to be run through a function. Well I can do that with for loop, but isn't it lengthy? Of course we have an alternative way named as filter() For example I have this list:  fruits = ( 'Banana' , 'Apple' , 'Black' , 'Avocado' , 'Blueberry' ) I want every single fruit name run through this function, which will print them individually: def myFunc (name): print (name) Now I want to modify all the items and run them through muFunc(name). I can firstly do it using for loop: fruits = ( 'Banana' , 'Apple' , 'Black' , 'Avocado' , 'Blueberry' ) def myFunc (name): print (name) for i in fruits: i += '-Fresh' myFunc(i) Output: Banana-Fresh App

Learning Python - 7th day (Night - 1)

 Watched tutorial: Click Here I have learnt about  Lambda tonight. lambda (minimizing a function()) How does this work? Okay, to understand this I am using a normal function first. Let's name the function as getNum(n) Example: def getNum (n): return n+ 10 print (getNum( 5 )) Output: 15 This is a normal function I already learned, right? But can I shrink the function to a smaller one? Yes! There is a way for shrinking functions in one line for one time use.  To do this we need to use lambda. The structure for lambda is:  lambda arguments : function For example: a = lambda n: n+ 10 print (a( 5 )) Output: 15 This is how you can use lambda to make shorter functions!