Showing posts with label Python. Show all posts
Showing posts with label Python. Show all posts

Mar 22, 2026

Install Linux Tools in Windows CMD

 





go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest

go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest

git clone https://github.com/sullo/nikto

cd nikto/program

perl nikto.pl -Version

May 6, 2024

Python (Tkinter)

from tkinter import *

ventana = Tk()
ventana.title("Hola Mundo") #Apps title
ventana.geometry("400x200") #This define the apps dimension


lbl = Label(ventana, text="Este es un label")
lbl.pack()

btn = Button(ventana, text="Presionar")
btn.pack()

ventana.mainloop()

May 5, 2024

Python (pip)

pip is the package installer for Python.

- pip list

- pip install request 

- python.exe -m pip install --upgrade pip




pip list in Python 

bs4  = 

May 4, 2024

Python (List and Tuple)

 h = (1,2,3,4,5,"Enam","Tujuh")

i = list(h)
>> [1, 2, 3, 4, 5, 'Enam', 'Tujuh']
j = tuple(i)
>> (1, 2, 3, 4, 5, 'Enam', 'Tujuh')

Jun 5, 2023

Python #6 (Boolean, Return)

--

name_list = ['4e+','mz','4education' ]
name = '4e+'
print(name == "mz")
print (name_list == 'mz')
print('mz' in name_list)
a = 'mz' in name_list
print(type(a))

>>

False False True <class 'bool'>


Jun 4, 2023

Python #5 (Indexing)


Indexing

item[start:stop:stepover]

item = 'abcdefgh'
print(item[0:3])
print(item[3:])
print(item[:3])
print(item[0:6:2])
print(item[::-1])
>>

abc defgh abc ace hgfedcba

Count, Replace, Capitalize, Upper, Lower

item = 'a a b c b a f g e h i i c b c e d'
print(item.capitalize())
print(item.upper())
print(item.count('b'))
item = item.replace('b', 'a')
print(item.count('a'))

May 21, 2023

Python #4 (Popular pip for Engineer and Scientist)

- Pandas              : Data analysis library

- Numpy             : Multi-dimensional arrays and matrices, along with a large collection of high-level mathematical functions

- Scipy                : Scientific computing and technical computing. SciPy contains modules for optimization, linear algebra, integration, interpolation, special functions, FFT, signal and image processing, ODE solvers and other tasks common in science and engineering

- TensorFlow       : Machine learning and artificial intelligence

- Keras                : Interface for artificial neural networks

- Scikit-learn        : Machine learning library,  It features various classification, regression and clustering algorithms including support-vector machines, random forests, gradient boosting, k-means and DBSCAN, and is designed to interoperate with the Python numerical and scientific libraries NumPy and SciPy. Scikit-learn is a NumFOCUS fiscally sponsored project

- PyTorch             : Machine learning framework based on the Torch library, used for applications such as computer vision and natural language processing

Python #3 (pip)

Install pip using command prompt

- Open cmd
- Write pip install numpy

Manual Install


- Click Setting
- Python Interpreter
- Click on install


- Write pip name, and install package



Nov 19, 2022

Python #1 (Basic)


String, Integer, Float, Boolean
item = "Hello world"             (string)
item = 24                                  (integer)
item = 24.034                           (float)
item = True or False               (Boolean)      
item = ['abc', 'cde', 'efg', 'hij'] (List)
item = [1, 2, 5, '4e+', True, 5] (List)
item =                                       (tuple)
item =                                       (set)
item =                                       (dict)

List
item = [1, 2, 5, '4e+', True, 5]
print (item[0]) = 1


Math Function
3 ** 2 = 9
20 / 3 = 6.66667
20 // 3 = 6
10 %  2 = 0
9 %  2 = 1
--------------------------
round (3.25) = 3
abs (3.25) = 3.25
abs (-3.25) = 3.25
--------------------------
bin (5) = 0b101
int ("0b101", 2) = 5
# in this case the value 2 in int( ) mentioned to binary
--------------------------
complex is combination integer and imaginary

 
Shortcut
Ctrl + D (Duplicate previous line)

Dec 27, 2021

Python #2

Common Command

quit ( )

String

# this for short string
name = "4edcuation"
print (name)

# for long string using 3 quote
name = """ 
4education
4edt
4e+
"""
# Concatenation of string
room = "room number" + str(10) 

# Escape Sequence

say_01 = "Hello it's me"
say_02 = "Hello it's \"me\" bro"
say_03 = "\t Hello it's \"me\ " bro"
say_04 = "\t Hello \n it's \"me\" bro"

\t for tab, and \n = enter or new line 

# Formatted string

name = '4edt'
age = 33
print ('hi '+ name + '. You are ' + str(age) + ' years old')
print (f'hi {name}. You are {age} years old')
print ('hi {}. You are {} years old'. format(name, age))


Try and Except

try:
x1 = float(input("Please enter the number: "))
except:
print("Error input number1")
>>
Please enter the number: 1
>>
Please enter the number: a
Error input number1

Text Format

var1 = "My NaMe"
print(var1.lower())
print(var1.upper())
print(var1.capitalize())
print(var1.title())
>>
my name
MY NAME
My name
My Name