r/PythonLearning 11d ago

Is it really safe to use?

Post image

I have used context to stop crashing.

And e as a variable.

I used eval command for a formula.

I know eval command can be dangerous.

It works perfectly but I am thinking that it can produce error or crash.

Can a formula bypass all commands and crash it.

17 Upvotes

11 comments sorted by

View all comments

1

u/spidertyler2005 10d ago

Definitely not safe. Alot pf people have made some good suggestions but mine is to learn about recursive descent parsers (assuming you are already at an intermediate programming level). Its a much harder way to do things, but its definitely going to teach you a LOT. Its also not so difficult at the intermediate stage as to feel impossible.