Aug-24-2023, 01:23 PM
(This post was last modified: Aug-24-2023, 01:24 PM by deanhystad.)
You do not want to open Python that way. Open a shell, CMD or Powershell, change directories to where your echo.py file is located, and type "python echo.py".
I do not understand what you mean by this:
Do you mean that at the python prompt you just typed "echo.py"? ">>>" is the prompt from the interactive python interpreter. It is prompting you to enter a python statement. For example:
I do not understand what you mean by this:
Quote:When after >>> I write the name of a python file, for example echo.py, the below error is shown:
Do you mean that at the python prompt you just typed "echo.py"? ">>>" is the prompt from the interactive python interpreter. It is prompting you to enter a python statement. For example:
Output:>>> sum(range(100))
4950
Or in your case:Output:>>> from echo import echo
>>> print(echo("echo"))
cho
ho
o
.