1

even stuff like help(int) seems to give me error in vs code terminal for python

help(int) int : The term 'int' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again. At line:1 char:6 + help(int) + ~~~ + CategoryInfo : ObjectNotFound: (int:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

Other examples:

from dateline import date At line:1 char:1 + from dateline import date + ~~~~ The 'from' keyword is not supported in this version of the language. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : ReservedKeywordNotAllowed

Although running this from the editor seems to be fine.

3
  • 1
    That's not a Python error message. It looks like you are running Python code in the interpreter of an other language (PowerShell?) Commented Dec 26, 2019 at 3:20
  • 1
    It's a terminal, not a python shell. In the terminal type: python and the python shell will start. Commented Dec 26, 2019 at 3:26
  • 1
    oh okay, why does the dropdown box say python then? Commented Dec 27, 2019 at 4:31

1 Answer 1

1

It seems that you're using the Python extension for VSCode.

As it is merely an interpreter that runs on PowerShell, you will still need to prepend your command with python for it to work, such as python script.py, shown in the screenshot below:

Python VSC

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.