python | Unsorted

Telegram-канал python - Python

135201

You will be muted until you read the rules. Read them! @Rules_for_Python A group about the Python programming language. Offtopic things go here: @pythonofftopic Resources to learn python: @pythonres Group for Hy: @hylang Selenium: @SeleniumPython

Subscribe to a channel

Python

import asyncio

why sometimes it treated as external library and sometime it works like normal python code without librrary 😕

Because also i used to clone a repo where in the requirements.txt there was this,

asyncio
😅

Читать полностью…

Python

Breaking rule #2 will get you banned even faster.

Читать полностью…

Python

i think most of the python library using the tg bot api, has the name of the fields same as the docs say in the tg api so those looks very similar, i thought

Читать полностью…

Python

Use a button properly with color as style,

            InlineKeyboardButton(
"Download Now",
url=MY_WEBSITE_LINK.url,
style=KeyboardButtonStyle.BLUE,
)

Читать полностью…

Python

https://realpython.com/python-concurrency/

Читать полностью…

Python

if you are not able to answet the question i recommend that you read on concurrency

Читать полностью…

Python

so... in parallel or serial? You are not answering

Читать полностью…

Python

You assume he knows what a tread is 😔

Читать полностью…

Python

No, if you use a library that's inherently asynchronous, then you should write good asynchronous code in at least the whole thread.

Читать полностью…

Python

Yes i am confsued what what i will do , but the confusion part is i am using python-telegram-bot, there i must need to use async code.

so you say i will use normal

await fun1
await fun2
like this not the asyncio.taskGroup, .create_task i should not looks to think for now ?

Читать полностью…

Python

I'm not convinced that your issue was synchronous code just yet. The thing with "synchronous" code is that it doesn't always mean sequential. There are still threads and processes. And depending on which one's you've used, it might have been just fine.

Читать полностью…

Python

Did synchronous code slow it down?

Читать полностью…

Python

I was some days researching about improve my PYthon code to speed up, so i choosed the async code, there it say, even i normally use,

await fun_name()
await 2nd_fun_name() in a async function, still the 2nd fun start after the first one is finish, is this correct thinking of me?

Another thigns they say i need to use the,

asyncio.create_taask(function_name, args,)
asyncio.create_task(2nd_fun_name, args, ...)

and now my both function will start here at same time not depends on the first fun to finish, is this right or not?

and now they say to use asyncio.TaskGroup !!!

I got confused in the part what should i use in reality 2nd option i think better ???
any sugession 🙏

Читать полностью…

Python

come to offtopic i can discuss there

Читать полностью…

Python

The industry is changing fast. I’m a full-stack Python developer, and the demand is shifting toward Generative AI and Agentic AI. Maybe that’s an area worth exploring.

Читать полностью…

Python

There's still time to rethink the approach.

Читать полностью…

Python

Or, you can just write:
style="success"

Читать полностью…

Python

Are both of you guys assuming a specific Python library/framework?

Читать полностью…

Python

start_Button = Button("start search",
callback_data=f"starttrip:{user_id}:{trip_id}",
style="success")

await query.message.edit_text(
message,
reply_markup=Markup([
[start_Button]]))

👍

Читать полностью…

Python

i could answer it for you but you should understand the basics first

Читать полностью…

Python

i dont know properly,
i want fun 1 start, fun 2 start also without waiting for finish of fun1 result, what is this i need to know for this type of code learning

Читать полностью…

Python

i want when first fun which do network call of post/get, when this is running, meantime the 2nd await fun2 should start running, so that my workflow will be faster anyway i want this,

Читать полностью…

Python

But that is living with a decision you already made. I'm wondering if you changed the library from synchronous to asynchronous because of an assumption that you cannot prove or at least did not fully understand.

Читать полностью…

Python

i mean, do you want or need your code in parallel or serial?

Читать полностью…

Python

By what you have described, I cannot know. But I don't need to know. My point is, you should know before you make a change. If you make changes based on assumption, that's not so good.

Читать полностью…

Python

yaa, i am doing sending a network request in one fun, another fun do open playwright and do take screenshot of the page, so it is slow down, so i want ot use async and do both together thats why i found i must need to use asyncio, is nto this i got wrong or not?

Читать полностью…

Python

you can use any you want, its kinda well explained in the docs, gather and TaskGroups have their uses.

With gather you can control the exceptions better than TaskGroup if cancellation is something that bothers you.

Читать полностью…

Python

This is not a Python specific question, please delete your offtopic message, move to @PythonOfftopic and ask there.

Читать полностью…

Python

import static_ffmpeg
from pydub import AudioSegment

# Automatically finds and sets up static binaries inside your virtualenv 🔧
static_ffmpeg.add_paths()
# Now pydub works with zero system-level ffmpeg installation! 🎉
audio = AudioSegment.from_file("input.m4a", format="m4a")
audio.export("output.mp3", format="mp3", bitrate="192k")

See this is a demo python code, i found for this code to use i don't need to have install ffmpeg in my system on startup of this app run it will download the ffmpeg binary inside my .venv folder and I found this is working.

And see is this really ok to use this in real development and hosting?
i found this setup not need ffmpeg in my system. But it works.
So i want to know what is i should to do?

i am asking this because i also listen in production we should not use like this ffmpeg in .venv

Читать полностью…

Python

Sometimes, the work I do doesn't align with my interests. I want to enjoy my work and know exactly what it is I want to enjoy about it. Unfortunately, I don't know how to leverage what I have to build a resume. I’d like to become an entrepreneur, but I don’t even know where to start.

Читать полностью…
Subscribe to a channel