Python Forum
input function visual studio terminal help
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
input function visual studio terminal help
#1
hi all, i been trying to figure out how to get the integrated terminal to work in visual studio code and i have no clue what going on. I have Extension Python Pack install by Don Jayamanne. I also added path to python in VS settings *python.pythonpath":"/usr/bin/python"* I also tried add configuration " add python terminal (integrate). Is there something I'm missing or am i doing something wrong? I followed https://donjayamanne.github.io/pythonVSC...sole-apps/ but does not work. Thanks for all your help so far.
 name = input("Please enter your name: ")
print("hello, " + name + "!")JJG-MacBook-Pro:python_work Beware$ python input.py
Please enter your name: dude
Traceback (most recent call last):
  File "input.py", line 1, in <module>
    name = input("Please enter your name: ")
  File "<string>", line 1, in <module>
NameError: name 'dude' is not defined
JJG-MacBook-Pro:python_work Beware$
Reply
#2
One other thing too add, I installed python 3.6.
When i use my mac terminal and I type python I get - Python 2.7.10 (default, Jul 14 2015, 19:46:27)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

When i type python3 in the mac terminal I get - Python 3.6.3 (v3.6.3:2c5fed86e0, Oct 3 2017, 00:32:08)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
Would this cause any problems having both installed? i guess python 2.7 comes pre-installed with mac computers?

thanks


Update:
I changed paths inside VS user settings to python3 /Library/Frameworks/Python.framework/Versions/3.6/bin/python3 and VS Integrated Terminal is working now, that solved my problem



thanks
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Visual Studio Code help aaronrousch 4 3,757 Jan-25-2025, 05:55 AM
Last Post: ndc85430
  I cannot create a virtual environment on visual studio code using python Willem_Aucamp316 2 2,771 Nov-27-2024, 02:20 PM
Last Post: menator01
  Input function oldschool 1 669 Sep-14-2024, 01:02 PM
Last Post: deanhystad
  Code Completion in Visual Studio for External Libraries mjakov 0 565 Aug-25-2024, 02:48 PM
Last Post: mjakov
  difference between forms of input a list to function akbarza 6 2,297 Feb-21-2024, 08:02 PM
Last Post: bterwijn
  How to set PYTHONPATH in Visual Studio Code? aupres 5 12,218 Aug-15-2023, 03:51 PM
Last Post: snippsat
  how do I open two instances of visual studio code with the same folder? SuchUmami 3 3,863 Jun-26-2023, 09:40 AM
Last Post: snippsat
  Visual Studio Code NewPi 3 2,024 May-16-2023, 11:13 PM
Last Post: snippsat
Information How to take url in telegram bot user input and put it as an argument in a function? askfriends 0 2,270 Dec-25-2022, 03:00 PM
Last Post: askfriends
  Visual Studio Code venv ibm_db error mesi1000 7 4,873 Nov-13-2022, 12:36 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020