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

Thanks All.
I got solved, actually i didnot add the
import sqlmodel
in my script.py.mako thats why it cause the problem till now 😅

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

Python

wait , is that you cookie ?

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

Python

how can you still send normal messages.?

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

Python

what are you working on ?

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

Python

ok bye leave this topics is overkilling me for now

Maybe the rocket science floating i will never need to learn

i just want to be learn simple website making Hosting and sell website 😅

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

Python

i think to start using the fast speed decimal calculations for my normal apps also? will it ok really?

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

Python

so which u will say i should learn, so that from now i will Learning Using simple fast speed of floating calculation for my own shopping app, school apps like this?

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

Python

you have just stop my mouth 😅 and just push me into the sea of confusion

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

Python

Read again the above message
And decide for yourself

And float(Decimal) does not make apsolutly no sense

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

Python

so n past u say :-> for all price, tax tables i should to always use the decimal.Decimal. from then i switched to this for all my code.
now what u say i will use in real production case. !

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

Python

i was calculating

Decimal("0.1")+Decimal("0.2")
decimal adding without causing any floating problem without using any external library!

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

Python

Can anyone help me with python's technology to build an ai driven app

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

Python

Yes, we have established that already.

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

Python

i means, as he says we will use library here for this!!!
but i found normally with the Decimal we can solve the float problem. so ehat rhe library be say to use

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

Python

That's the case with all programming languages
Floating numbers are handled with a binary representation, so there will be an overflow at times
There are libraries designed to handle that though

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

Python

Hello i am getting frastrutated to use Alembic today newly in a new repo:
1st:-> alembic init --template pyproject alembic
after i run this command it generate a alembic/env.py in the file i edited this:

from sqlmodel import SQLModel
from models import *
# upper import all the model class i have

config.set_main_option(
name="sqlalchemy.url",
value=DATABASE_URL,
)
target_metadata = SQLModel.metadata

After i adding these thigns in the alembic/env.py, i found the issue:
alembic revision --autogenerate -m "initial migration"
Running this cause error:
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
ERROR [alembic.util.messaging] Can't locate revision identified by 'f29236eae9ff'
FAILED: Can't locate revision identified by 'f29236eae9ff'

is this any mistake i am doing in my way any logic problem or maybe as i copy past code of alembic1.19.2 and now today 1.20.0 is causing the issue:
What is the best way i can check how i can solve this.

i did vs code's ctrl+shift+f search but not foudn anythign pointing f29236eae9ff.

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

Python

At least you have fun.

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

Python

building a distributed async python backend rn messing with asyncio event loops, concurrent workers, multithreading, websocket streams, REST APIs, request queues, proxy rotation, rate-limit handling, JSON serialization, regex parsing, redis caching, postgres, connection pooling, dependency injection, docker containers, CI/CD pipelines, exception handling, retry logic, exponential backoff, memory profiling and some absolutely fucked race conditions

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

Python

i hate how coding in python has mentally changed my life i remember back in the day when i was just a normal guy with a normal life now im up at 4am debugging some async asyncio multithreaded api scraper because my requests are getting rate limited and throwing 403s while im staring at stack traces rewriting functions fixing dependencies and wondering why the fuck my virtual environment broke again

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

Python

No, thats not the point

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

Python

I just told you
What other information you need?

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

Python

If you are doing financial math - use Decimal

If you are calculating a trajectory for a rocket, use external libraries

DO NOT use Fraction to represent floating point numbers

That's it

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

Python

Fractions get slower and slower as you work with them, and are rarely used for representing floating point numbers

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

Python

float(decimal.Decimal('.1') + decimal.Decimal('.2'))
and
float(fractions.Fraction('0.1') + fractions.Fraction('0.2'))

so will should i use the fraction?

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

Python

If you were to calculate floats for currency, prices, legal and tax documents
Then yes, you use Decimal
But as its software based and on base-10 rule, it makes it slower to work with then other solutions

But for high precision and high speed calculation needed for example in data science or calculating a rocket orbit
You need something with high precision, where the error at the 50th decimal place does not affect the outcome

So it comes down to what you are actually calculating

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

Python

No, that's not what we do here.

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

Python

/channel/Python/2266296

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

Python

What are you calculating?

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

Python

why library i listen we should to do

Decimal("0.1") + Decimal("0.2")

like this, eo why need library

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

Python

That was too easy, thx for the assist

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