Forwarded from Cᴏᴅᴇs Sɴɪᴘᴘᴇᴛs (</> ᴍᴜᴋᴇsʜ </>)
What is the output of this code snippet?
Anonymous Quiz
45%
(1, 2, 3, 4, 5)
30%
[1, 2, 3, 4, 5]
21%
Error
3%
None
Convert PDF to docx using Python
📂 Tags: #DataScience #Python #ML #AI #LLM #BIGDATA #Courses
⭐️Add coding folder 👇
https://t.me/addlist/2UhsQW_cGzkxMzg1
📂 Tags: #DataScience #Python #ML #AI #LLM #BIGDATA #Courses
⭐️Add coding folder 👇
https://t.me/addlist/2UhsQW_cGzkxMzg1
👍4🔥1
Exclusion from the queue
The collections.deque() class is a generalization of stacks and queues, and represents a deque. A deque() supports thread-safe, memory-efficient operations for inserting and removing elements of a sequence from either side, with roughly the same O(1) performance in either direction.
#CodeSnippet
#ProgrammingFun
#python3
#python
⭐️Add coding folder 👇
https://t.me/addlist/2UhsQW_cGzkxMzg1
The collections.deque() class is a generalization of stacks and queues, and represents a deque. A deque() supports thread-safe, memory-efficient operations for inserting and removing elements of a sequence from either side, with roughly the same O(1) performance in either direction.
#CodeSnippet
#ProgrammingFun
#python3
#python
⭐️Add coding folder 👇
https://t.me/addlist/2UhsQW_cGzkxMzg1
❤1👍1
Forwarded from PYTHON PROGRAMMING (</> ᴍᴜᴋᴇsʜ </>)
Creating Virtual Environment for Python
» Download Python
» Steps to create '
1. Navigate to the folder where you want to make your project
Example:
2. Open terminal (local terminal, command prompt, or vs code terminal) in that folder
3. Now, use these commands
4. Your virtual environment is created in that folder, now activate this virtual environment using this command.
Command for 'Command Prompt':
Command for 'Powershell':
Command for Git Bash or WSL:
If Powershell gives you error like
5. Congratulations🎊 Your virtual environment activated now make your project
Happy Coding 👨💻
» Download Python
First you need python installed in your local machine to create virtual environment.
Download Python from Here
» Steps to create '
.env' folder (virtual environment for python)1. Navigate to the folder where you want to make your project
Example:
cd D:/code/
2. Open terminal (local terminal, command prompt, or vs code terminal) in that folder
3. Now, use these commands
python --version # Type this and hit enter to verify the python version
# Now use these commands
python -m venv .env
4. Your virtual environment is created in that folder, now activate this virtual environment using this command.
Command for 'Command Prompt':
.\env\Scripts\activate
Command for 'Powershell':
.\env\Scripts\Activate.ps1
Command for Git Bash or WSL:
source \.env\bin\activate
If Powershell gives you error like
File cannot be loaded because running scripts is disabled then use this command!Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
5. Congratulations🎊 Your virtual environment activated now make your project
Happy Coding 👨💻
👍4❤1
def func(a, b=2, c=3):
return a + b + c
print(func(1, c=4))
👍1
Forwarded from Cᴏᴅᴇs Sɴɪᴘᴘᴇᴛs (</> ᴍᴜᴋᴇsʜ </>)
· Send paid media using pyrofork
· Requirements
· Requirements
pip install pyrofork
from pyrogram import Client,idle,filters,types
app=Client("paidmedia",bot_token="bot_token_here",api_hash="api_hash_here",api_id="api_id_here")
@app.on_message(filters.command("sendpaidmedia"))
async def payout(b,m) :
await b.send_paid_media(
chat_id=m.chat.id,
stars_amount=100,
media=[
types.InputMediaPhoto("img.jpg"),
],
caption="This is a secret message. pay to watch")
if __name__=="__main__":
print("client started")
app.run()
idle()
@CodesSnippet
Happy Coding 👨💻
❤1
🎉📚 Exciting Offer Alert! 🎉📚
get ₹1000 off on your admission or re-registration in IGNOU
🌟 Don't miss out on this fantastic opportunity! 🌟
Note :
Get 100% ✅ gurrenty if any issue your money will be refunded💯 within 10 minutes
Hurry, limited time offer! ⏳
👉 Contact us now to grab your discount:- @itz_legendcoder 📞💬
get ₹1000 off on your admission or re-registration in IGNOU
🌟 Don't miss out on this fantastic opportunity! 🌟
Note :
Get 100% ✅ gurrenty if any issue your money will be refunded💯 within 10 minutes
Hurry, limited time offer! ⏳
👉 Contact us now to grab your discount:- @itz_legendcoder 📞💬
🎉 Happy New Year, Coders! 🎉
As we step into this new year, may your code be bug-free and your projects be fulfilling! 💻✨
🔧 Embrace challenges as opportunities to learn and grow! Remember, every line of code is a step toward mastery. 🚀
🌟 Keep pushing boundaries, exploring new technologies, and collaborating with others. Your creativity knows no limits! 🌐
Let’s make this year the one where your ideas come to life. Happy coding and happy New Year! 🍾🥳💻
As we step into this new year, may your code be bug-free and your projects be fulfilling! 💻✨
🔧 Embrace challenges as opportunities to learn and grow! Remember, every line of code is a step toward mastery. 🚀
🌟 Keep pushing boundaries, exploring new technologies, and collaborating with others. Your creativity knows no limits! 🌐
Let’s make this year the one where your ideas come to life. Happy coding and happy New Year! 🍾🥳💻
❤1
Get System Information
Jᴏɪɴ ᴜs :- @Python_Codes_Pro
Support group :- @python_group_pro
import psutil
import platform
from sys import version as pyver
from pyrogram import __version__ as pyrover
def get_system_info():
p_core = psutil.cpu_count(logical=False) # Physical cores
t_core = psutil.cpu_count(logical=True) # Logical cores
ram = str(round(psutil.virtual_memory().total / (1024.0**3))) + " GB"
try:
cpu_freq = psutil.cpu_freq().current
if cpu_freq >= 1000:
cpu_freq = f"{round(cpu_freq / 1000, 2)} ɢʜᴢ"
else:
cpu_freq = f"{round(cpu_freq, 2)} ᴍʜᴢ"
except Exception:
cpu_freq = "ғᴀɪʟᴇᴅ ᴛᴏ ғᴇᴛᴄʜ"
# HDD information
hdd = psutil.disk_usage("/")
total_hdd = round(hdd.total / (1024.0**3), 2) # Total space in GB
used_hdd = round(hdd.used / (1024.0**3), 2) # Used space in GB
free_hdd = round(hdd.free / (1024.0**3), 2) # Free space in GB
# Return system information as a dictionary
return {
"Physical Cores": p_core,
"Logical Cores": t_core,
"RAM": ram,
"CPU Frequency": cpu_freq,
"HDD Total": f"{total_hdd} GB",
"HDD Used": f"{used_hdd} GB",
"HDD Free": f"{free_hdd} GB",
"Python Version": pyver.split()[0] if pyver else "Unknown",
"Pyrogram Version": pyrover
}
if __name__ == "__main__":
system_info = get_system_info()
text=""
for key, value in system_info.items():
text+=f"{key}: {value}\n"
print(text)
Jᴏɪɴ ᴜs :- @Python_Codes_Pro
Support group :- @python_group_pro
❤1
Forwarded from Cᴏᴅᴇs Sɴɪᴘᴘᴇᴛs (</> ᴍᴜᴋᴇsʜ </>)
Which module in the python standard library parses options received from the command line?
Anonymous Quiz
22%
getopt
25%
getarg
33%
main
20%
os
Forwarded from Cᴏᴅᴇs Sɴɪᴘᴘᴇᴛs (</> ᴍᴜᴋᴇsʜ </>)
Is Python case sensitive when dealing with identifiers?
Anonymous Quiz
23%
No
65%
Yes
12%
Machine Dependent
👍2
def getPrint(name="world", some):
print(f"Hello {name}")
getPrint("Chiku", 55)
print(f"Hello {name}")
getPrint("Chiku", 55)
Anonymous Quiz
38%
Hello World
35%
Hello Chiku
9%
Hello 55
18%
Error
❤2
Flask app that interacts with the Waifu API to fetch and display tags and search for images based on parameters you provided. 🚀
### Flask App Structure
1. Install Flask: Make sure you have Flask installed. You can do this via pip:
2. Create your Flask app: Below is the complete code for the Flask app:
3. Create Template File:
Create a folder named
How to Run the App
1. Save the Python script (e.g.,
2. Run the Flask app:
3. Open your web browser and go to
### Flask App Structure
1. Install Flask: Make sure you have Flask installed. You can do this via pip:
pip install Flask
2. Create your Flask app: Below is the complete code for the Flask app:
from flask import Flask, jsonify, render_template
import requests
app = Flask(__name__)
@app.route('/')
def home():
return render_template('index.html')
@app.route('/tags')
def get_tags():
url = 'https://api.waifu.im/tags'
response = requests.get(url)
if response.status_code == 200:
data = response.json()
return jsonify(data)
else:
return jsonify({'error': 'Request failed with status code:', 'status': response.status_code}), response.status_code
@app.route('/search/<tag>')
def search_images(tag):
url = 'https://api.waifu.im/search'
params = {
'included_tags': [tag],
}
response = requests.get(url, params=params)
if response.status_code == 200:
data = response.json()
return jsonify(data)
else:
return jsonify({'error': 'Request failed with status code:', 'status': response.status_code}), response.status_code
if __name__ == '__main__':
app.run(debug=True)
3. Create Template File:
Create a folder named
templates in the same directory as your Flask app and create a file named index.html.<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Waifu App</title>
</head>
<body>
<h1>Welcome to the Waifu App! 🌟</h1>
<h2>Available Tags and Image Search</h2>
<p>Use the following endpoints:</p>
<ul>
<li><a href="/tags">Get Tags</a></li>
<li>Search Images: <a href="/search/maid">Maid Images</a></li>
</ul>
</body>
</html>
How to Run the App
1. Save the Python script (e.g.,
app.py) and the HTML file.2. Run the Flask app:
python app.py
3. Open your web browser and go to
http://127.0.0.1:5000/ to see the app in action! 🎉❤5👍4
Jinke pass bhi Groups hain 10 members se 250 members tak ke vo mujhe de sakte hain
(Only telegram groups no newly created)
And don't comment here directly message me
Minimum Price 50 rupye maximum price can be 100 vary based on group
And in special group case it will be more
@Panditsiddharth
Or Call 6389680622
(Only telegram groups no newly created)
And don't comment here directly message me
Minimum Price 50 rupye maximum price can be 100 vary based on group
And in special group case it will be more
@Panditsiddharth
Or Call 6389680622
👍3
Forwarded from Cᴏᴅᴇs Sɴɪᴘᴘᴇᴛs (</> ᴍᴜᴋᴇsʜ </>)
How can you select a specific column from a DataFrame?
Anonymous Quiz
25%
df.select_column("ColumnName")
30%
df.get_column("ColumnName")
35%
df["ColumnName"]
10%
df.column("ColumnName")
Forwarded from Cᴏᴅᴇs Sɴɪᴘᴘᴇᴛs (</> ᴍᴜᴋᴇsʜ </>)
How can you filter rows in a DataFrame based on a condition?
Anonymous Quiz
26%
df.filter(condition)
25%
df[condition]
22%
df.select_rows(condition)
27%
df.filter_rows(condition)
Forwarded from Cᴏᴅᴇs Sɴɪᴘᴘᴇᴛs (</> ᴍᴜᴋᴇsʜ </>)
How can you drop a column from a DataFrame in Pandas?
Anonymous Quiz
16%
df.remove_column("ColumnName")
36%
df.drop_column("ColumnName")
27%
df.remove("ColumnName", axis=1)
21%
df.drop("ColumnName", axis=1)
Forwarded from Cᴏᴅᴇs Sɴɪᴘᴘᴇᴛs (</> ᴍᴜᴋᴇsʜ </>)
What does the groupby() function in Pandas allow you to do?
Anonymous Quiz
15%
Group DataFrame columns
41%
Group DataFrame rows based on a condition
30%
Group data based on one or more columns
15%
Group data based on the index
Forwarded from Cᴏᴅᴇs Sɴɪᴘᴘᴇᴛs (</> ᴍᴜᴋᴇsʜ </>)
How can you merge two DataFrames in Pandas?
Anonymous Quiz
25%
df.concat()
20%
df.join()
46%
df.merge()
9%
df.combine()
👍3❤1