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

I see it now. Thanks 🙏

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

Python

7️⃣ Ads

• Ads are not allowed!
• Don't post advertisements or promotions (even worse if it's your own blog-posts)!
• But sharing open-source projects is OK if you ask for permission to post GitHub (or similar) repos in the meta group!
• Don't mention other groups, channels or bots.

This is the part of the rules I read before sending the message.

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

Python

Rules in our groups are strictly enforced. It is strongly recommended to read our rules before engaging in any other activity!

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

Python

okay, could you send it to the meta group?

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

Python

Work with not against the library/framework you use. And frankly, the dictionary is not nice.

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

Python

This is like saying when a user will run python and the result is showing in terminal, sometime emoji, unicode characters not shows properly so i listen we need to reconfigure our sys.stdout, is this need or not btw i am now in confusion???

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

Python

WTF why so specific? Why would he need to reconfigure these?

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

Python

Check out @PythonRes, a channel for Python resources - video courses, pdf books, tutorials and other info to help you learn Python.

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

Python

I wish you research first about what is
sys.stdout and sys.stderr and wha tis reconfigure of these.

Try to understand these thigns first then you will learn about writing code in ur laptop and then you know how to write and how to get the output there first and then start from there from basic.

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

Python

Hi everyone! I’m new to Python and I want to learn Python programming from the basics. I’m a complete beginner, so please suggest some good resources, PDFs, or courses that can help me learn step by step. Any help would be appreciated. Thank you! 🙌🐍

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

Python

Do you have a PDF of a book where I can learn Python? Can you help me with this?

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

Python

Do not use FastAPI as Flask
Problem solved 🤷‍♂

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

Python

Reusable block of code.
It takes in data (called arguments) and produces a result.

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

Python

There's still time to rethink the approach.

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

Python

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

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

Python

See, that part also mentions the meta group.

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

Python

Hi everyone, I’m learning Python and looking for 1–3 people who also want to learn together. We can practice, share small projects, help each other, and stay motivated. If you’re interested, message me.

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

Python

I don't know the meta group and the link is not on the group info

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

Python

Hello everyone,

I’m Seth, an intermediate programmer who works primarily with Python, Rust, and C.

I have read the community rules, and I would like to ask for permission to share a GitHub link to a small tool I built with Python.

The project was intentionally built using only Python’s standard library. One of the reasons for this approach is that I currently have limited computing resources, so I wanted to avoid relying on external packages and unnecessary dependencies.

I would also genuinely appreciate feedback on the project especially if there are things I have done that may look correct at first but are technically wrong, inefficient, or could be improved. I’m here to learn, so constructive criticism is very welcome.

If it is okay with the community guidelines, I would be happy to share the GitHub link.

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

Python

info: Dict[str, Any] = {
"id": song_id,
"title": "Dj Bhojpuri Song",
"audio_url": None,
"image_url": None}


Currently, I store this information in a dictionary and retrieve values from it later. I have considered using @dataclass as a simpler alternative. However, I also noticed that FastAPI provides BaseModel. Given that I am working with raw dataclasses within a DDD structure, which option would you recommend? I am confused because I have previously asked an AI assistant about this, and it provided contradictory advice: it initially praised the dictionary approach, then suggested @dataclass was excellent, and finally claimed BaseModel was the best choice. What is the best choice for this specific scenario?

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

Python

https://pythonbooks.org/free-books/

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

Python

What?

If u bother with that go write C dude, its the original sin of modern programming langs after all

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

Python

if ur cool with video tutorials -> bro code on YT
if ur cool with written manuals -> w3schools.com

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

Python

Why do want to learn Python?

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

Python

Check out @PythonRes, a channel for Python resources - video courses, pdf books, tutorials and other info to help you learn Python.

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

Python

also right flask jinja has used goodly but here in fastapi with
<link rel="icon" href="{{ url_for('static', filename='favicon.ico') }}">
but filename here in fastapi give me server problem

Becasue i am trying to coming to fastapi as i lsiten when my website in flask response one user another user is still pending not do any response to him, thats why i am going to ues the faastpi by replacing all old thigns same html, css, js here and want to use jinja and i foudn url_for() like this works good in in fastapi>

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

Python

See In case of flask apps we do,
@app....
...
return render_templaet(filenam.html)

but in case of fastapi, why i has
to write ,
response_class=HTMLResponse in the top of the @app.get("//..)

also sometime they do like,

@app.get("/")
async def home():
return FileResponse("static/index.html")

again also
@app.get("/", response_class=HTMLResponse)
async def index(request: Request):
return templates.TemplateResponse(
request=request,
name="index.html",
context={}
)

The req
so what approach i should to follow if i want mostly to serve html file like jinja and so on from fastapi, what is best fast? because i am confsued why to give the request obj here in the template, as that does not need to know in return of the html .

what part if i read and know which will solve all the confusion of all thise?

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

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

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