Cambo Souce Code Python
283 subscribers
1 photo
1 file
5 links
ប្រសិនបើលោកអ្នកយល់ថាវាមានប្រយោជន៍សម្រាប់អ្នក សូមជួយគាំទ្រពួកយើងតាមរយៈ
My ABA : 001916722
My Name : YOUT CHENG
Download Telegram
import random
import string

# Define the length of the key
key_length = 64

# Generate a 64-character random key
key = ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(key_length))

print("Random Key:", key)


Random Keys 64
👍1
import qrcode

# Data to encode
data = "https://t.me/EmiToolsComChannel"

# Create QR code instance
qr = qrcode.QRCode(
version=1, # controls the size of the QR Code, values from 1 to 40
error_correction=qrcode.constants.ERROR_CORRECT_L, # controls error correction
box_size=10, # size of each box in pixels
border=4, # thickness of the border (4 is the default)
)

# Add data to the instance
qr.add_data(data)
qr.make(fit=True)

# Create an image from the QR Code instance
img = qr.make_image(fill_color="black", back_color="white")

# Save the image
img.save("qrcode.png")

បង្កើត QR Code
2😱2
pip install speedtest-cli
import speedtest

def check_internet_speed():
st = speedtest.Speedtest()

print("Fetching best server...")
st.get_best_server()

print("Performing download test...")
download_speed = st.download() / 1_000_000 # Convert to Mbps
print(f"Download speed: {download_speed:.2f} Mbps")

print("Performing upload test...")
upload_speed = st.upload() / 1_000_000 # Convert to Mbps
print(f"Upload speed: {upload_speed:.2f} Mbps")

ping = st.results.ping
print(f"Ping: {ping:.2f} ms")

# Run the test
check_internet_speed()

ពិនិត្យល្បឿនអ៊ីនធឺណិតដោយប្រើ Python
4👏2
import names

first_name = names.get_first_name(gender='male')
print(first_name)

full_name = names.get_full_name(gender='female')
print(full_name)


Create Name
1
from datetime import datetime

# Get the current date
current_date = datetime.now().date()

# Print the current date
print("Today's date is:", current_date)

Time
pip install rembg


from rembg import remove from PIL import Image
input_path = 'cl.jpg'
output_path = ' 'output.png'
input = Image.open(input_path)
output = remove(input)
output.save(output_path)

Remove Image Background
import os

module_path = os.path.dirname(os.path.realpath(file))

input_path = os.path.join(module_path, 'input_file')
output_path = os.path.join(module_path, 'output_file')

print(input_path)
print(output_path)
pip install instaloader

import os
import instaloader
os.system("mode con cols=50 lines=10")
loder = instaloader.Instaloader()

username = input ('Enter Username :')
profile = instaloader.Profile.from_username(loder.context,username)
for download in profile.get_posts():
loder.download_post(download,target=f'{username}')


Download from Instagram
4👍1
import yt_dlp

# Replace with your YouTube video URL
youtube_video_url = input ('@username :')
video_url = f"https://www.youtube.com/{youtube_video_url}/shorts"
# Options for yt-dlp
ydl_opts = {
'format': 'best',
'outtmpl': '%(title)s.%(ext)s',
}

# Download the video
with yt_dlp.YoutubeDL(ydl_opts )as ydl:
ydl.download([video_url])
print("Video downloaded successfully. ")

Download YouTube Shorts
🥰1
ប្រសិនបើលោកអ្នកយល់ថាវាមានប្រយោជន៍សម្រាប់អ្នក សូមជួយគាំទ្រពួកយើងតាមរយៈ
My ABA : 001916722
My Name : YOUT CHENG
👍1
from PIL import Image, ImageDraw, ImageFont
def add_watermark(input_image_path, output_image_path, watermark_text):
original = Image.open(input_image_path).convert("RGBA")
txt = Image.new("RGBA", original.size, (255, 255, 255, 0))
font ImageFont.truetype("arial.ttf", 40)
draw ImageDraw.Draw(txt)
width, height = original.size
text_bbox draw.textbbox((0,0), watermark_text, font=font)
text_width = text_bbox[2] - text_bbox[0]
text_height = text_bbox [3] text_bbox[1]
position (width text_width 10, height text_height 10)
draw.text(position, watermark_text, fill=(255, 255, 255, 128), font=font)
watermarked = Image.alpha_composite (original, txt)
watermarked.show()
watermarked.convert("RGB").save(output_image_path, "JPEG")
add_watermark("cl.jpg", "cloutput.jpg", "emi-tools.com")
1
from fake_useragent import UserAgent
# Initialize UserAgent instance
ua = UserAgent()
# Generate a random user agent
random_user_agent = ua.random
print(random_user_agent)
import pyautogui
#import time
a = 0
# text= ""
while True:
#while a<1000:

#time.sleep(2)
if a<5:
text ="Hi"
#else:
#text ="Hi"
pyautogui.typewrite(text)
pyautogui.press("enter")
a+=1
import emoji 
def text_to_emoji(text):
return emoji.emojize(text)
input_text = input(&quot;Enter text with emoji aliases: &quot;)
converted_text = text_to_emoji (input_text)
print(&quot;Converted Text with Emojis: &quot;, converted_text)
from PIL import Image, ImageFilter 
def blur_image (image_path, output_path, radius):
image Image.open(image_path)
blurred_image = image. filter (ImageFilter.GaussianBlur (radius)) blurred_image.save(output_path)
stop = 5  # Set stop value
Numstop = int(stop) # Convert stop to an integer (in this case, it's already an integer)
break_count = 0 # Initialize break_count

while True: # Infinite loop
break_count += 1 # Increment break_count on each iteration
if break_count == Numstop + 1: # If break_count equals Numstop + 1 (i.e., 6), break the loop
break # Exit the loop
import random
import string

def generate_email(username):
# Generate random letters and numbers
letters = ''.join(random.choices(string.ascii_letters, k=3)) # e.g., 3 random letters
number = random.randint(100, 999) # e.g., a random number between 100 and 999
# Generate the email
email = f"{username}+{letters}{number}@yandex.com"
return email
# Example usage
username = "exampleUser"
email = generate_email(username)
print(email)
2
from deep_translator import GoogleTranslator 

# Translate to Spanish
translated_text = GoogleTranslator(source='auto', target='km').translate("Hello, how are you?")

# Print the translated text
print(f"Translated Text: {translated_text}")