Python Codes Basic to Advance @python_codes_pro Channel on Telegram

Python Codes Basic to Advance

@python_codes_pro


Python Codes Basic to Advance

All Codes
@C_Codes_pro
@CPP_Codes_pro
@Python_Codes_Pro
@Java_Codes_Pro
@nodejs_codes_pro

Discussion
@bca_mca_btech

Python Codes Basic to Advance (English)

Are you looking to take your Python coding skills to the next level? Look no further than the 'Python Codes Basic to Advance' Telegram channel! This channel, with the username @python_codes_pro, is dedicated to providing a wide range of Python codes from basic to advanced levels. Whether you are a beginner looking to learn the basics or an experienced coder looking to enhance your skills, this channel has something for everyone.

With a variety of codes available, ranging from simple programs to complex algorithms, you will have the opportunity to explore different aspects of Python programming. Additionally, the channel provides links to other coding channels such as @C_Codes_pro, @CPP_Codes_pro, @Java_Codes_Pro, and @nodejs_codes_pro, allowing you to expand your coding knowledge beyond Python.

In addition to sharing codes, the 'Python Codes Basic to Advance' channel also offers a platform for discussions related to coding. Whether you have questions, want to share your own coding experiences, or simply interact with other like-minded individuals, you can do so in the channel's discussion section @bca_mca_btech.

So, if you are passionate about Python coding and eager to improve your skills, join the 'Python Codes Basic to Advance' channel today! Enhance your coding knowledge, engage in discussions, and become a part of a vibrant coding community. The possibilities are endless when you have access to valuable resources and a supportive community. Don't miss out on this opportunity to take your Python coding skills to the next level!

Python Codes Basic to Advance

07 Jan, 16:25


Get System Information
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

Python Codes Basic to Advance

31 Dec, 18:44


🎉 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! 🍾🥳💻

Python Codes Basic to Advance

28 Dec, 02:49


🎉📚 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 📞💬

Python Codes Basic to Advance

19 Dec, 14:01


def func(a, b=2, c=3):
    return a + b + c

print(func(1, c=4))

Python Codes Basic to Advance

01 Dec, 16:47


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

Python Codes Basic to Advance

30 Nov, 07:32


Convert PDF to docx using Python

📂 Tags: #DataScience #Python #ML #AI #LLM #BIGDATA #Courses

⭐️
Add coding folder 👇
https://t.me/addlist/2UhsQW_cGzkxMzg1

Python Codes Basic to Advance

26 Nov, 07:58


x = (1, 2, 3)
x += (4, 5)
print(x)

Python Codes Basic to Advance

18 Nov, 07:50


THIS PROGRAM WILL FIND YOUR COUPLE YOU JUST NEED TO CHOOSE YOUR GENDER AND ENTER NAME
try:
from faker import Faker
except:
import os
os.system("pip install faker")

fake = Faker()
F = fake.first_name_female()
M = fake.first_name_male()


enter = input('''Select your Gender!
M:---> for Male
F:---> for Female \t''').upper()

if "M" in enter:
PRINCE = "Enter your name I will find your princess 💖\t"
M = input(PRINCE).capitalize()

elif "F" in enter:
PRINCESS = "Enter your name I will find your Prince💖\t"
F = input(PRINCESS).capitalize()

elif input.str("M", "F") not in enter:
print("try again")
else:
print("wrong input")

# Made by @mr_sukkun
couple1 = {M: F}
couple = {value: key for key, value in couple1.items()}

if "M" in enter and M in couple1:
print("Hey "+ M, couple1[M], "is your Girlfriend 💖")

if "F" in enter and F in couple:
print("Hey "+F, couple[F], "is your Boyfriend 💖")

Python Codes Basic to Advance

14 Nov, 03:29


Urgent need of python Developer
Skill required:
Python in advance
Database: Mongodb
And Pyrogram Library

Dm:- @Itz_legendCoder

Python Codes Basic to Advance

07 Nov, 14:20


Send solution in comment section

Python Codes Basic to Advance

02 Nov, 03:41


Reading from a File
Python provides several methods to read the contents of a file.
read() Method
Reads the entire content of a file as a single string.

Example:
with open("example.txt", "r") as file:
content = file.read()
print(content) # Prints the entire file content


readline() Method
Reads one line at a time from the file.

Example:
with open("example.txt", "r") as file:
line = file.readline()
print(line) # Prints the first line of the file


readlines() Method
Reads all lines of a file and returns them as a list of strings.

Example:
with open("example.txt", "r") as file:
lines = file.readlines()
print(lines) # Prints all lines in a list

Python Codes Basic to Advance

02 Nov, 03:41


Writing to a File
To write content to a file, you can use the write() or writelines() methods. Opening a file in write ('w') mode will create the file if it doesn’t exist or overwrite it if it does.

write() Method
The write() method writes a string to the file.
Example:
with open("output.txt", "w") as file:
file.write("Hello, World!\n")
file.write("This is a Python program.\n")


writelines() Method
The writelines() method takes a list of strings and writes them to the file.
Example:
lines = ["First line\n", "Second line\n", "Third line\n"]

with open("output.txt", "w") as file:
file.writelines(lines)

Python Codes Basic to Advance

02 Nov, 03:41


Opening and Closing Files
Opening a File

To open a file, use the open() function.

Example:
file = open("example.txt", "r")

This will open the file example.txt in read mode ('r').

Closing a File
It’s good practice to close a file after you are done with it using the close() method. This frees up system resources.
file.close()

Alternatively, you can use the with statement to automatically close the file after the block of code is executed.

Example:
with open("example.txt", "r") as file:
content = file.read()
print(content) # File is automatically closed after the block

Python Codes Basic to Advance

02 Nov, 03:41


Handling File Exceptions
File operations can result in errors, such as trying to open a non-existent file in read mode. You can handle such cases using exception handling with try and except.

Example:
try:
with open("non_existent_file.txt", "r") as file:
content = file.read()
except FileNotFoundError:
print("File not found. Please check the filename.")

Python Codes Basic to Advance

02 Nov, 03:41


Appending to a File
When you want to add content to the end of an existing file without overwriting it, you can use the append mode ('a').

Example:
with open("output.txt", "a") as file:
file.write("This line will be appended.\n")

Python Codes Basic to Advance

02 Nov, 03:41


Working with Binary Files
In addition to text files, you can also work with binary files such as images, videos, and executables by opening the file in binary mode ('b').

Reading a Binary File
Example:

with open("image.jpg", "rb") as file:
binary_content = file.read()
print(binary_content) # Outputs the binary content of the image


Writing to a Binary File
Example:

with open("new_image.jpg", "wb") as file:
file.write(binary_content) # Writes binary content to a new file

Python Codes Basic to Advance

02 Nov, 03:41


File Positioning: seek() and tell()
tell(): Returns the current position of the file pointer (in bytes).
seek(offset, from_what): Moves the file pointer to a specified location.

Example:
with open("example.txt", "r") as file:
print(file.tell()) # Prints the current position of the file pointer
file.seek(0) # Moves the pointer to the beginning of the file
print(file.read())

Python Codes Basic to Advance

02 Nov, 03:41


Introduction to File Handling
Python provides built-in functions to work with files. The most common operations include:
Opening a file: open()
Reading from a file:
read(), readline(), readlines()
Writing to a file:
write(), writelines()
Closing a file:
close()

Syntax:
file = open("filename", "mode")

The mode defines how the file will be opened:
'r': Read (default mode, raises an error if the file does not exist)
'w': Write (creates a new file if it does not exist, overwrites existing content)
'a': Append (creates a new file if it does not exist, appends to existing content)
'x': Create (creates a new file, raises an error if the file exists)
'b': Binary mode (e.g., 'rb' for reading binary files)
't': Text mode (default mode, used for reading/writing text files)

Python Codes Basic to Advance

02 Oct, 14:46


Isme i option correct hai sorry for wrong code

Aap logo ko koi bhi code ho use khud se test karke dekhna chahiye

Aur agar koi code wrong lage to use batana chahiye comment me

Isse hame lagega ki aap bhi coding man se kar rhe

Python Codes Basic to Advance

21 Sep, 11:45


way to create array and perform operation using numpy.
pip install numpy

code :
import numpy as n

# creating array
d=n.array([1,2,3])
d2=n.array([4,5,6])
print(d) #it doesnt seperated with comma
print(d2) #it doesnt seperated with comma
# performing operation
print(d+d2) #it adds the corresponding elements of the arrays
print(d2-d) #it subtracts the corresponding elements of the arrays

print(d*d2) #it multiplies the corresponding elements of the arrays

#similary you can do operation with single element
d3=n.array([10])
print(d*d3)
print(d+d3)
print(d-d3)

Output:-
[1 2 3]
[4 5 6]
[5 7 9]
[3 3 3]
[ 4 10 18]
[10 20 30]
[11 12 13]
[-9 -8 -7]

Python Codes Basic to Advance

29 Aug, 14:46


In these days rust is getting much popular

1) Because of it's speed of execution.
2) It's full controll on system memory
3) it's ownership model
4) And integration to other languages

So why wait let's join our rust channel
https://t.me/Rust_Codes_Pro

Python Codes Basic to Advance

15 Aug, 03:26


आप सभी को स्वतंत्रता दिवस की हार्दिक बधाई 🇮🇳🇮🇳

Python Codes Basic to Advance

13 Aug, 14:27


Become Termux Expert in Hindi Series Video No.: 7 | Change Termux Permission
https://youtu.be/53b40lkce3s

Python Codes Basic to Advance

11 Aug, 03:27


1. भारतीय संविधान को लिखने का कार्य किसने किया था?
- भारतीय संविधान को प्रेम बिहारी नारायण रायज़ादा ने अंग्रेजी में और वसंत कृष्ण वैद्य ने हिंदी में हाथ से लिखा था।

2. संविधान सभा का अध्यक्ष कौन था?
- .....
More details join: https://t.me/SidsAnalysis/38

Join for daily intrusting knowledge

Python Codes Basic to Advance

08 Aug, 09:55


Create any compiler and run on your own compiler any code
https://youtu.be/4EE-D341z6c

Python Codes Basic to Advance

06 Aug, 04:52


s = "hello, world!"
print(s[6:12])

Python Codes Basic to Advance

03 Aug, 04:05


Join our main support Group for coders:
@BCA_MCA_BTECH

More:
https://t.me/addlist/hiZsuZYwYzJmMWQ1

Python Codes Basic to Advance

19 Jul, 16:18


Government ne google ki dadagiri ko khatm karne ke liye apna khud ka app store banaya hai 🔥😍

Playstore pe jo apps hain unhe 30% Playstore ko apni kamayi ka hissa dena padta hai

https://apps.mgov.gov.in/details?appid=270

Aap sabhi ye government playstore ko download kare Aur logo ko bhi share Kare

Government ne to apna Kam Kar diya ab hamari Bari.