how to input python code in run time and execute it?

后端 未结 3 1459
一个人的身影
一个人的身影 2021-01-17 06:52

Well i want to input a python function as an input in run time and execute that part of code \'n\' no of times. For example using tkinter i create a textbox where the user w

3条回答
  •  忘掉有多难
    2021-01-17 07:01

    Python provides number of ways to do this using function calls: - eval() - exec()

    For your needs you should read about exec.

提交回复
热议问题