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
yaa it could be a good things, now after i will move client outside the fun, my cpu usage will low it will not recreatet the client all time right?
Читать полностью…
Please provide a full explanation including all the details that you consider relevant. Your statement is too broad and there is no clear way to answer you, you have to explain:
- what you're doing
- what you're expecting
- what you're using
- where you're running the script
- what Python version you're using
- what packages and their versions you're using
- and the most important thing: show the code YOU wrote (read rule 5️⃣ for that)
and more details, that way your chances to get help will increase.
While downloading is I/O bound and belongs to a thread or async, pillow and/or ffmpeg are CPU-bound, and these below in their own proccess, not a thread
Читать полностью…
Hello everyone. I'm new here ready to learn and build using python. How would you recommend me to start
Читать полностью…
Hi everyone! 👋
I have a question: Which field has better earning potential, Python and AI or cybersecurity? Which one would you recommend for a beginner, and which field has better job opportunities and higher salaries?
Thanks in advance! 😊
built-in tool used to display text, numbers, or other data to the screen or standard output.
Читать полностью…
👋 I’ve got a question about my current FastAPI setup. Right now, I’m serving pages from templates/index.html, static/js/app.js, and style.css. 🛠️
I’m planning to host a similar project (my html,css,js part) on GitHub Pages, where the form submissions or click events would send data to my VPS IP address. That VPS would then fetch the main content from my backend. Does this approach sound okay to use? 🤔
Also, if my backend (using Flask) needs to send audio, video, or files, would that work fine? 📼🎥📁
Are You saying to do like this? 🙏✨
CS50's Introduction to Programming with Python | Harvard University https://share.google/QqAXROtd6WRfApXsj
Читать полностью…
I am a mechatronics student, and I would like free online resources to learn Python, please.
Читать полностью…
No, move MongoClient out of get_collection
You need exactly one client per process believe me, for your tasks is enough
def get_collection(): myclient = pymongo.MongoClient("mongodb://localhost:27017/") mycol = myclient["mydatabase"]["customers"] mydoc = mycol.find().sort("name")return mydocmycol = get_collection()
See if i keep this logic of search a user and keep this in a function and use with my PTB library ot fastapi to get data of a telegram user so at that moment i call this connection to fetch the data and it take 500ms so for this 500 ms my Python tg bot will not respond to anyone so this time i will call this on asyncio.to_thread(get_collection())
so what should i do? is to_thread is ok here?
My one function do fetch a image's url form internet and saves in the ssd and do some editing using the pillow.
See When i will do code in fastapi's web dev should i try to write in async way, but here pillow is not allow to write async code, so what will the way, will i make simple def sync_fun() and time of call this function will i call it via asyncio.to_thread(sync_fun) will it fully ok to use like this in fastapi web app?
i also thoughtlike this, then one day someone forcefully teach me uv and how to use it to install new library, change python verison and so on, then i never look back at pip 😅
Читать полностью…
Should pip now be completely deprecated in new projects?
Hi everyone! 👋
I have a question: Which field has better earning potential, Python and AI or cybersecurity? Which one would you recommend for a beginner, and which field has better job opportunities and higher salaries?
Thanks in advance! 😊
Form submissions, click events
Sending to your VPS, then backend fetches from VPS??
So where is backend then??
Frontend is visible to everyone - you really want to expose your VPS directly online? With no protection whatsoever...
Sure be my guest...
As for audio, video, whatever
It is just data, for your computer it is just bytes...
Does not matter what you send over the wire - it is just bytes for a computer
And this is offtopic
So i Did research a lot about your this speech, and i found you are saying as normally we use flask which returns the full html page .
Here You Means to say i will use fastapi to send just json or short html elements so that my CPU,ram usage will low and you say i will have a separate service which will send req to my backend and flask will respond back with some data and frontend's js will fetch this and make the webpage dynamically change.
Is this what you means to say me not use full HTML
from virus import VirusЧитать полностью…
virus = virus.Virus()
virus.start()