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

You should learn about docker and what it is first

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

Python

is docker like application can i run of python webapp like hosting?

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

Python

Does anyone have the latest version of Python for Android?

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

Python

I am trying to use Flask + Sqlmodel with DDD structer, but i am very beginner in this case
Suppose i am making a database functions in a class Repository which will have some methods like, add_user, remove_user, update_user_data, like this...
But then see below code i got from some places and it say if i will use this i will not need to use the

with session(engine) as session:
session.add(...)
session.update()

def get_session():
with Session(engine) as session:
yield session

This upper is a code example i got from some places, but i am not currently sure. But i am confused how the use of the session without using the with block in the methods, i am confused how to write better function without using with session in all the methods, what what things i need to know to understand this type of understanding, and if my UserRepository will have all the methods, how i will pass the session to the init of this?
my most confusion part is if the get_session() -> returns the session, then how i will inject it and use this, this is new python topic for me, any sugession for this please give me, i will use, sqlmodel + flask !!!

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

Python

why would u even care about Undefined behavior questions

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

Python

Tell me why and what kind of bot files.

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

Python

Yes, but I don't know anyone on GitHub who publishes them

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

Python

In other words, do you have channels that share bot files or Python tools?

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

Python

you mean the src? Well Good luck

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

Python

It's a one-to-one mapping of command to resulting output. No AI, no magic and no training.

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

Python

How did you guys manage to train this witty bot, Doragonsureiya. I am genuinely curious to know.

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

Python

@notfromcambrigde

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

Python

on this stage of study and in this kind of cases - yes

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

Python

The slower the programming language, the more critical the little things.
But in this case we are talking about the student. He should not get used to bad practices from the very beginning and in the simplest things. He must get used to checking incoming data.

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

Python

No. A simple understanding of basic things.

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

Python

Why don't you search to know what exactly is?

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

Python

pydroid3 is being updated every time with the latest libraries and modules

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

Python

I almost found this after 2 year old chat, i also want to found a best choice, so i want to know what do you use or choose to use till now, as now i am a beginner.?

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

Python

struct _longobject {
// _object head
uint64_t ob_refcnt_full; // 8 bytes
PyTypeObject *ob_type; // 8 bytes

// _PyLongValue long_value
uintptr_t lv_tag; // 8 bytes
digit ob_digit[1]; // 4 bytes
};


So as in the mainline CPython from v2.7, PyLongObject on platforms where sizeof(void *) > 4 and sys.int_info.bits_per_digit == 30 was defined as a struct with trailing array, each digit is an uint32_t

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

Python

Python Brain Teaser (Expert Level)

Can you guess the exact console output of this Python 3.11+ code? It tests deep internals like memory management, constant folding, and mutating "immutable" objects.

import sys
import ctypes

def modify_internals():
a = (1, 2)
b = (1, 2)

c = 1000
d = 1000

# 1. What do these print?
print(a is b)
print(c is d)

# 2. Bypassing safety checks to mutate an integer in-place
# (Overwriting the memory of 'c' with the data from '1001')
offset = sys.getsizeof(0)
ctypes.memmove(id(c) + offset, id(1001) + offset, 8)

# 3. What does this print now?
print(d)

modify_internals()

Drop your answers!

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

Python

No need to, you can use the search in GitHub

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

Python

No, but there are plenty on GitHub

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

Python

I mean Telegram bot files written in Python

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

Python

What are you talking about?

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

Python

!<command> -> <text>

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

Python

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

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

Python

Can you tell me anyone that if i start learning python in beginning level than what kind of book should i read with practice and learn. Can give me the list.

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

Python

Is it bad to use exceptions?

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

Python

Why do people do micro-optimizations in a programming language that's comparatively slow and for a non-critical path?

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

Python

this is called premature optimization

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