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
Omg hey! so like, you're literally doing way too much here tbh. files.upload() already saves the zips to your colab folder automatically! You don't need that whole for loop at the bottom to write the files all over again, that's prob why it's crashing and acting super weird. Just delete everything after the upload() line and you're good to go bestie!
Читать полностью…
from google.colab import files
import os
uploaded = files.upload() # select all 4 zips at once in the picker
for name, data in uploaded.items():
with open(name, 'wb') as f:
f.write(data)
print(f'{name}: {len(data)/1e6:.1f} MB saved')
Am trying to run this but failed..any corrections 😭
What do you want to do exactly? Like readon, editing, writting excel files in python?
Читать полностью…
I m not a programmer but wanna learn to python in excel
Читать полностью…
yaa i like to chat and discusss about python and programming in general i am also learning things alone, so frieds are very welcome and appriciated, i also wish others to message me for talking like this things
Читать полностью…
you pasted the code from the sqlmodel docs ?
here the session is a context manager, as the sqlmodel session, but as later i will use the di-flask library as says in upper message in reality but here session i shows as the docs say to use.
@app.post("/heroes/", response_model=HeroPublic)
def create_hero(hero: HeroCreate):
with Session(engine) as session:
db_hero = Hero.model_validate(hero)
session.add(db_hero)
session.commit()
session.refresh(db_hero)
return db_hero
db_hero, which is a Hero model instance. However, because response_model=HeroPublic is specified in the FastAPI decorator, FastAPI automatically validates/converts the returned object according to the HeroPublic response model.response_model that I can specify in a Flask route decorator, so that my function can simply return a Hero object and Flask automatically serializes/validates it according to a HeroPublic schema?return HeroPublic.model_validate(hero_obj)
I was trying to use SqlModel , Pydantic in a flask web app, the problem i am finding, like my confusion is i found some code examples like they are using flask.g, actually i am confused should i will use this in my real code to generate session for the sqlmodel, as in flask there is not any Depends like fastapi has one,
i am confused how i should start using the session when i will follow the sqlmodel functions for login, register or some others things,
my main problem is shoudl i start using this, i dont know will this ok in real production,
def get_db_session() -> Session:Читать полностью…
if "db_session" not in g:
g.db_session = Session(engine)
return g.db_session
Read it
pererikbergman/repository-design-pattern-e28c0f3e4a30" rel="nofollow">https://medium.com/@pererikbergman/repository-design-pattern-e28c0f3e4a30
Apply to your project
Does not matter if its Django, Flask, or whatever else you may choose
Design patterns are language (and framework) agnostic
hello everyone
who can help me with repository pattern in django ?
I need to extract python code from .exe and its on 3.11 I am unable to do it any leads
Читать полностью…
Hali Shon, please verify you are human by clicking the button below. You have 90 seconds.
Читать полностью…
Well, you should do a course in python and learn the according libraries to use excel, i've used some.
I wouldn't say it's extremely difficult.
Yaa, by the way thanks for trying to help me, i am actually want to get help from this python community who have already use this thigns.
Читать полностью…
I have made FastAPI style DI for flask if you want to use it: https://github.com/razorblade23/di-flask
Otherwise, you can use g to keep the session "opened" but i would advise against that as session should be closed on every transaction.
Its better to open session on each transaction and close it afterwards, prefferebly using with Session(engine) as session: context manager
Also me and other people, but this is the wrong group to talk about that
Читать полностью…
A different group where you can talk about what you do and ask about how other people feel without being told that your contributions aren't suited for the group.
Читать полностью…
Create a telegram bot that answers with a beginner project everytime someone asks for beginner projects
Читать полностью…