简体   繁体   中英

How do I get python to run in visualStudioCode MacOS

I would like to run python 2.17 on my Mac through VisualStudioCode. However I keep getting this error message. Any idea why?

I have tried copying the code to a new file and restarting VCS.

Traceback (most recent call last):
  File "/Users/Home/Documents/_Sue IT Polytech 2019/Software Development/LinkedInPyTutOct2019/Exercise Files/Chap03/03_05_begin.py", line 2, in <module>
    name = input("What's your name? ")
  File "<string>", line 1, in <module>
NameError: name 'Sue' is not defined
Suzannes-MBP:Exercise Files Home$

Expected output was the program to continue with the task. The program asks a name, one is given and then a 'detailed' message is supposed to appear.

As you said you're using Python 2.x.

Use raw_input instead of input to get string from user.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM