Python Codes Basic to Advance
2.66K subscribers
82 photos
5 videos
8 files
100 links
Python Codes Basic to Advance

All Codes
@C_Codes_pro
@CPP_Codes_pro
@Java_Codes_Pro
@nodejs_codes_pro

Discussion
@bca_mca_btech
Download Telegram
Forwarded from ˹ᴍʀ sᴜᴋᴋᴜɴ˼ (Mᴜᴋᴇsʜ)
Media is too big
VIEW IN TELEGRAM
fully responsive web🥀
website 🖇: https://mukesh-api.vercel.app/

🥀 sᴜᴘᴘᴏʀᴛ :  @Mr_Sukkun
# python

Simple python GUI calculator.

from tkinter import *
from tkinter import messagebox
top=Tk()
top.geometry('10x40')
top['bg']="red"
uname = Label(top, text="This is a Simple GUI Calculator",bg='green' ,height=2).place(x=150, y=10)
firstnum=IntVar()
secondnum=IntVar()
def add():
f=firstnum.get()
s=secondnum.get()
messagebox.showinfo('Sum is',(f+s))

num1= Label(top, text="First Number" ).place(x=50, y=150)
ent1= Entry(top,bg='white',textvariable=firstnum).place(x=300, y=150)



num2= Label(top, text="Second Number" ).place(x=50, y=250)
ent2= Entry(top,bg='white',textvariable=secondnum).place(x=300, y=250)



btn= Button(top, text="SUM",command=add).place(x=250, y=400)


top.mainloop()

join :- @Python_Codes_Pro

Support group :- @python_group_pro
6👍1
from PIL import Image
from io import BytesI0
from base64 import b64decode
import requests
url =f"https://mukesh-api.vercel.app/imgword"
r=requests.get(url).json()["results"]
word=requests.get(url).json() ["word"]
x=BytesI0 (b64decode(r))
# u can it directly in tg
print (word)
# to save img
img= Image.open(x)
img.show()



join :- @Python_Codes_Pro

Support group :- @python_group_pro
3
Guess the ouput?
1
# get random wallpaper for pc

import requests

base_url="https://mukesh-api.vercel.app/"
class Wallpaper:
def __init__(self):
pass
def wall(self):
url=f"{base_url}wallpaper"
return requests.get(url).json()["results"]
H=Wallpaper()
print(H.wall())

Output:
 https://graph.org//file/23edcc969e96d2181d185.jpg


Join :- @Python_Codes_Pro

Support group :- @python_group_pro
2
Python-Cheat-Sheet.pdf
677.7 KB
Python-Cheat-Sheet.pdf
Guess the ouput?
2🔥2
import requests
chapter_number=input("enter chapter number between 1-18:->> ")

class BhagwatGita:
def __init__(self, url):
self.url = url

def get_info(self):
response = requests.get(self.url).json()
# print(response["chapter_number"], response["verse"], response["chapter_intro"], response["shalok"])
print(response)


url = f"https://mukesh-api.vercel.app/bhagwatgita?query={chapter_number}"
bhagwat_gita = BhagwatGita(url)
bhagwat_gita.get_info()
2👍1
Forwarded from ˹ᴍʀ sᴜᴋᴋᴜɴ˼ (Mᴜᴋᴇsʜ)
This media is not supported in your browser
VIEW IN TELEGRAM
🇮🇳 Happy Republic Day 🇮🇳
2👍2
import requests

base_url="https://mukesh-api.vercel.app/"

class Flirt:

'Random flirt msg'

def __init__(self):

pass

def flirt(self):

url=f"{base_url}flirt"
return requests.get(url).json()["results"][0]

H=Flirt()

print(H.flirt())
#Output:
'Do you have a sunburn, or are you always this hot? 🔥😏'


# Random flirt msg
😁2
import requests
base_url = "https://mukesh-api.vercel.app/"

class Wikipedia:
def __init__(self, search_str):
self.search_str = search_str

def search_wikipedia(self):
url = f"{base_url}wikipedia?query={self.search_str}"
response = requests.get(url)
if response.status_code == 200:
return response.json()["results"]
else:
return "Failed to fetch data from Wikipedia."

search_term = input("Search anything on Wikipedia: ")
wikipedia_search = Wikipedia(search_term)
print(wikipedia_search.search_wikipedia())


Search anything from Wikipedia and get summary of that term.
1
import requests
base_url = "https://mukesh-api.vercel.app/"

class IMDb:
def __init__(self, search_str):
self.search_str = search_str

def search_imdb(self):
url = f"{base_url}imdb?query={self.search_str}"
response = requests.get(url)
if response.status_code == 200:
return response.json()["results"]
else:
return "Failed to fetch data from IMDb."

search_term = input("Search movie info from movie name: ")
imdb_search = IMDb(search_term)
print(imdb_search.search_imdb())

Get Movie info from IMDb website
1
print(8+~9)
Anonymous Quiz
32%
17
35%
-1
10%
-2
23%
Dont know
2👍2🔥1😁1
Python Crash Course.pdf ( PDFDrive.com )-1 (1).pdf
5.4 MB
Python Crash Course

Join :- @Python_Codes_Pro

Support group :- @python_group_pro
2
import requests

class GoogleImageAPI:
"""
A simple class to interact with the Google Image API.
"""

def __init__(self, base_url):
"""
Initialize the GoogleImageAPI with the base URL of the API.

Args:
base_url (str): The base URL of the API.
"""
self.base_url = base_url

def search_images(self, query):
"""
Retrieve images from Google Image API based on the query.

Args:
query (str): The search query for images.

Returns:
dict: A dictionary containing the API response.
"""
endpoint = f"{self.base_url}/googleimg?query={query}"
headers = {"accept": "application/json"}

response = requests.get(endpoint, headers=headers)

if response.status_code == 200:
return response.json()
else:
return {"error": f"Failed to retrieve images. Status code: {response.status_code}"}

# Instantiating the class
google_image_api = GoogleImageAPI(base_url="https://mukesh-api.vercel.app")

# Searching for images
result = google_image_api.search_images(query="Boy")
print(result)
Forwarded from ˹ᴍʀ sᴜᴋᴋᴜɴ˼ (Mᴜᴋᴇsʜ)
import requests

class Blackbox:
"""
A class to interact with the Blackbox API.

Attributes:
base_url (str): The base URL of the Blackbox API.
"""
def __init__(self):
self.base_url = "https://mukesh-api.vercel.app/blackbox"

def make_request(self, query):
"""
Makes a request to the Blackbox API with the provided query.

Args:
query (str): The query string to send to the API.

Returns:
dict: The JSON response from the API.
@mr_sukkun
"""
url = f"{self.base_url}?query={query}"
headers = {
"accept": "application/json"
}
response = requests.get(url, headers=headers)
return response.json()

# Example usage
box = Blackbox()
result = box.make_request("hi")
print(result)

# blackbox ai alternative of chatgpt using python
by : @mr_sukkun
1
x = "3"
y = 2
print (x+y)
Anonymous Quiz
50%
Error
29%
32
21%
5