Cᴏᴅᴇs Sɴɪᴘᴘᴇᴛs
رفتن به کانال در Telegram
👩💻 Wᴇʟᴄᴏᴍᴇ ᴛᴏ @CodesSnippet! 🚀 Jᴏɪɴ ᴜs ғᴏʀ ᴅᴀɪʟʏ sɴɪᴘᴘᴇᴛs ᴏғ ᴄᴏᴅɪɴɢ 🧩 ᴋɴᴏᴡʟᴇᴅɢᴇ! 💻💡 Hᴇʀᴇ, ʏᴏᴜ'ʟʟ ғɪɴᴅ 👀 ʙɪᴛᴇ-sɪᴢᴇᴅ ᴘɪᴇᴄᴇs ᴏғ ᴄᴏᴅᴇ, 🔥 ᴘʀᴏɢʀᴀᴍᴍɪɴɢ ᴛɪᴘs, ᴀɴᴅ ᴛʀɪᴄᴋs ᴛᴏ ʟᴇᴠᴇʟ ᴜᴘ ʏᴏᴜʀ ᴄᴏᴅɪɴɢ sᴋɪʟʟs! 💪💻 Sᴛᴀʏ ᴜᴘᴅᴀᴛᴇᴅ ᴏɴ ᴛʜᴇ ʟᴀᴛᴇsᴛ ᴛʀᴇɴᴅs ɪɴ ᴛᴇᴄʜ
نمایش بیشترکشور مشخص نشده استفناوری و برنامهها51 481
305
مشترکین
اطلاعاتی وجود ندارد24 ساعت
-67 روز
-630 روز
آرشیو پست ها
Repost from Python Codes Basic to Advance
Find system name , version processor using python.
import platform
system_name = platform.system()
system_version = platform.version()
architecture = platform.architecture()[0]
processor = platform.processor()
print("OS:", system_name)
print("OS Version:", system_version)
print("32 or 64:", architecture)
print("Processor :", processor)
Jᴏɪɴ ᴜs :- @Python_Codes_Pro
Support group :- @python_group_proRepost from ᴍʀ sᴜᴋᴋᴜɴ
Run Javascript code using python subprocess Library
import subprocess
js_code = """
console.log("Hello, World!");
"""
with open("script.js", "w") as file:
file.write(js_code)
result = subprocess.run(["node", "script.js"], capture_output=True, text=True)
print(result.stdout)
By : @Mr_SukkunRepost from Python Codes Basic to Advance
Which of the following is not one of the quotation marks we use when writing code in Python?
⌨️ Remove the Background of an Image Using Python
# pip install rembg pillow
from rembg import remove
from PIL import Image
input_path = "in.png"
output_path = "out.png"
input = Image.open(input_path)
output = remove(input)
output.save(output_path)
📱 Join us for more Python tips: @CodesSnippet
#python #programming #code #python3 #dailypostTask:
You have to create a program where a list of numbers is given and a number of rotation is given. Now you to bring last number of list in front and swift each number to the right. Do this till the given number of rotation.
Sample :-
input - [1,2,3,4] , 2
output - [4,1,2,3] -> [3,4,1,2]
Good luck!
Check either string is an
Anagram or not?
def is_anagram(str1,str2):
return sorted(str1)==sorted(str2)
#print(is_anagram("astronomer","moonstarer"))
#Output : True# Convert Timestamp to Indian Time Zone Using Python.
import datetime
import pytz
def convert_timestamp_to_ist(timestamp: int) -> str:
utc_date_time = datetime.datetime.utcfromtimestamp(timestamp)
utc_time_zone = pytz.timezone('UTC')
utc_aware_datetime = utc_time_zone.localize(utc_date_time)
ist_time_zone = pytz.timezone('Asia/Kolkata')
ist_aware_datetime = utc_aware_datetime.astimezone(ist_time_zone)
formatted_date = ist_aware_datetime.strftime('%A, %Y-%m-%d %H:%M:%S')
return formatted_date
# print(convert_timestamp_to_ist(1717000920))
Output:Wednesday, 2024-05-29 22:12:00
