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 meant Python Software Automation  for instance file automation ,excel automation , API automation and more.....

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

Python

Hi guys, can anyone suggest a python course for automation?

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

Python

The fastest way to learn Python is to get started right away. And if you are confused about something, feel free to ask here. Try a book.

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

Python

How can I learn Python quickly? I feel like it’s really difficult and confusing, and there are so many things to learn.

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

Python

Let's say, within a month or so?

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

Python

Is it necessary to create a venv even if the project is finished and was working fine?

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

Python

Comparatively perhaps. But doesn't mean you'll become a good developer over night. It's effort nonetheless. I'd rather say Python is pretty and versatile.

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

Python

I understand the desire to get things done, but this particular group is about learning Python. Not commanding LLMs.

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

Python

I want changes in my website NGL

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

Python

Have only made websites using codex 🙂‍↕️✨

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

Python

That'd be a good start.

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

Python

And this is getting out of topic

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

Python

but but i am found one issue whatever i am taking values form the .env of my python and send it on the @context_processor, but actually the user can inspect and visist the secure private data i send to there using html to js. so no security there he can visit this values i pass over this

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

Python

I have a question about passing data from Python to HTML hidden fields. When inserting values from Python into my HTML hidden fields, I sometimes need to pass the correct data type. For example, if I have a variable like money = float, I need to send it, but HTML stores it as a string, so JavaScript will try to convert it into an int and use it.

Additionally, consider this regular expression:

var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;

In this case, how should I take it from Python's backend and pass it into JavaScript, given that this is not a simple string type in JS? Also, if I want to pass this via a Python context_processor, what should the data type be in Pydantic's pydantic-settings?

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

Python

You pass it to HTML document and grab its value with JS 🤷‍♂

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

Python

For most RPA scenes I don't think you'll need to take a course, because you simply operate a11y tree and perform UI automation
Just read the documentation of the most popular library

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

Python

Helllo Flask users,
See when i use Flask, i use like this below code a fun

@app.route("/video/<string:video_id>")
def xyz_fun_to_handle_this():
....

but see it accept any url/video/abc123, url/video/xyz123,

But how i can only accept the part of
url/video/youtube_video_link i.e.
url/video/any_link,

how i can do this take any link after the /video/any_https_link, how i can do say this?
so that when i will get the video/link i want this functuion will execute only. any idea for this, i want only valid https link to take by my flask function

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

Python

basics will be covered in a month

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

Python

Ohh that's great, thanks

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

Python

in my project have python, docker files and json

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

Python

👋 I agree with clouded. You must effort in code. I can help you develop your own project.

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

Python

Ohh
But python is easy isn't it?

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

Python

But that's so hard atp😭😭

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

Python

And you want to change that?

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

Python

Ohh, got it
I tryda learn it through gpt

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

Python

i was looking into Flask and Flask-WTF today and noticed a recommendation to use CSRF tokens as much as possible. as I understand that even if a page doesn't have a form, we should still check for CSRF on PUT, PATCH, or UPDATE requests, thats' why the token is often placed in the meta head tag.

My question is: when JavaScript fetches data and sends requests automatically, should I attach the CSRF token to these requests?
I read that for automatic JS operations, we can use @csrf.exempt and avoid passing the token. What do you guys think? and i also listen i should never use exept for db query, what do you guys would choose in this case for automatic js request from the browser to server should we impliment csrf token in flask-wtf?

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

Python

You do not put secrets in frontend
That is a simple rule at least

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

Python

Depending on how much JS you need to inject, you could consider using .format() on a js as a string and replace the values that way 🤷‍♂

So you skip all the python > html > js dance
https://docs.python.org/3/builtins/stdtypes.html#str.format

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

Python

yaa thats looks logical now, i will do serachElementBYID in my js code from a hidden <span> and from there the js will take the value 😅

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

Python

Hello, I was using Flask to build HTML with Jinja and send it to the user's browser like this: 🐍

return render_template("index.html", user=user_data, money=users_db.money_value,)

for this case, user and money values are inserted into the Flask template on the fly coming from Python3.

However, when I try to send the
/static/js/filename.js
file, it is served automatically. As a result, I have to hardcode each variable in the .js file, since Flask automatically sends the .js file to the user without dynamic context. 😢

var UUID_RE =-Za-z0-9_-]+)/;

var SHORT_RE = ([A-Za-z0-9_-]+)/i;
var HOOK_RE = -9a-f]{4}-[0-9a-f]{12})/i;

var DEFAULT_PROXY = "/api/endpoint/somethign?url=";
var HOOK_API = "/video/web/somethign";


The content above is from my different .js files as an example. To clarify, I want my JS files to also be dynamic, similar to how I pass user and money values in the HTML. I want to pass values to the .js files dynamically. What is the best way to achieve this, considering that I found that Jinja functions and variables are not working in the .js file?

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