skip to Main Content

When I write in my terminal: vim calculator.py

It gives me the following error:

>>> vim calculator.py
  File "<stdin>", line 1
    vim calculator.py
        ^^^^^^^^^^
SyntaxError: invalid syntax

How can I solve that this line of code will create a new python file called calculator?

2

Answers


  1. SyntaxErorr is a python error. You are trying to execute vim calculator.py in a python interpreter.

    Try to run your command vim calculator.py on a command line instead.

    Login or Signup to reply.
  2. you did not open a terminal but a Python REPL

    open a cmd or Powershell terminal

    or use the + button in the top menu of the Explorer Bar File View

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search