Companies Home Search Profile

Evaluate Expressions Dynamically With Python eval()

Focused View

Christopher Trudeau

49:37

270 View
  • 01 eval overview.mp4
    03:06
  • 02 eval usage.mp4
    10:54
  • 03 eval globals.mp4
    07:23
  • 04 eval expr.mp4
    04:23
  • 05 eval compile.mp4
    03:15
  • 06 eval sec.mp4
    11:52
  • 07 eval mee.mp4
    06:03
  • 08 eval summary.mp4
    02:41
  • eval sample code.zip
  • eval slides.pdf
  • Description


    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.

    In this tutorial, you’ll learn:

    The code in this course was tested with Python 3.9.0, eval() has not changed much and older versions should be compatible.

    What You'll Learn?


    • How Python’s eval() works
    • How to use eval() to dynamically evaluate arbitrary string-based or compiled-code-based input
    • How eval() can make your code insecure and how to minimize the associated security risks

    More details


    User Reviews
    Rating
    0
    0
    0
    0
    0
    average 0
    Total votes0
    Focused display
    Category
    Christopher Trudeau
    Christopher Trudeau
    Instructor's Courses

    Christopher has a passion for the Python language and writes for Real Python. He is a consultant who helps advise organizations on how to improve their technical teams. Christopher is a strong advocate for automation throughout the delivery process and the power of small teams with well defined goals.

    You can find Christopher here:

    Learn Python online: Python tutorials for developers of all skill levels, Python books and courses, Python news, code examples, articles, and more.
    • language english
    • Training sessions 8
    • duration 49:37
    • Release Date 2023/01/05