Тёмный

Python eval() - Evaluate Expressions Dynamically 

Real Python
Подписаться 189 тыс.
Просмотров 5 тыс.
50% 1

The built-in Python function `eval()` is used to evaluate Python expressions. You can pass a string containing Python, or a pre-compiled object into `eval()` and it will run the code and return the result.
Although Python's `eval()` is an incredibly useful tool, the function has some important security implications that you should consider before using it. In this course, you'll learn how `eval()` works and how to use it safely and effectively in your Python programs.
Click here to learn more: realpython.com/courses/evalua...

Опубликовано:

 

1 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 4   
@marekjablonski2854
@marekjablonski2854 Год назад
Very clear explained. Thank you for sharing your expertise.
@96Ash69
@96Ash69 3 года назад
very helpful
@_Rishabh_Kumar
@_Rishabh_Kumar 2 года назад
Thanks!
@ivanweiss4016
@ivanweiss4016 2 года назад
thanks so much i had a problem in a code that had to do something like this create a variable (var_1) that would be 1 of a list of complex variables ) or could be 1 class from a list of dataclasses i needed to load data in to a variable but the variable is defined only in execution and this works code = "variable_1 = " + complex_record_variable.__doc__.split('(')[0] + "()" exec(code) thanks
Далее
Python's map() Function: Transforming Iterables
21:20
Просмотров 4,1 тыс.
НЕ ДЕЛАЙТЕ УКЛАДКИ В САЛОНАХ
00:43
КАКОЙ У ТЕБЯ ЛЮБИМЫЙ МАРМЕЛАД?
00:40
All 71 built-in Python functions
19:58
Просмотров 44 тыс.
Python Decorators in 15 Minutes
15:14
Просмотров 428 тыс.
Be Careful When Using exec() or eval() in Python
9:17
Defining Functions in Python
27:54
Просмотров 9 тыс.
5 Good Python Habits
17:35
Просмотров 403 тыс.
If __name__ == "__main__" for Python Developers
8:47
Просмотров 383 тыс.
Python Eval programming tutorial
5:01
Просмотров 54 тыс.
Using Python enumerate() With for Loops
14:01
Просмотров 24 тыс.
НЕ ДЕЛАЙТЕ УКЛАДКИ В САЛОНАХ
00:43