Sep-23-2023, 12:01 PM
hi
when i was reading the page https://realpython.com/python-eval-funct...es-of-eval about eval() in python, i encounterd a problem.
in the code (the below code is on the above page):
why did not the code run successfully?
I have another question:
is it possible to take information about something in Python? For example, suppose I want to know about %
usage in Python. when I am in idle , I wrote help(%), and it takes an error as
thanks
when i was reading the page https://realpython.com/python-eval-funct...es-of-eval about eval() in python, i encounterd a problem.
in the code (the below code is on the above page):
# Run the echo command import subprocess eval("subprocess.getoutput('echo Hello, World')") # Launch Firefox (if available) eval("subprocess.getoutput('firefox')")when I ran it, I took the below :
Error:"'firefox' is not recognized as an internal or external command,\noperable program or batch file."
I think the code is used for running Firefox from inside Python. is it true?why did not the code run successfully?
I have another question:
is it possible to take information about something in Python? For example, suppose I want to know about %
usage in Python. when I am in idle , I wrote help(%), and it takes an error as
Error:SyntaxError: invalid syntax
. how can I take information about something in idle?thanks