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
  difference between forms of input a list to function akbarza 6 1,006 Feb-21-2024, 08:02 PM
Last Post: bterwijn
  How to set PYTHONPATH in Visual Studio Code? aupres 5 4,038 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 865 Jun-26-2023, 09:40 AM
Last Post: snippsat
  Visual Studio Code NewPi 3 1,039 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 1,070 Dec-25-2022, 03:00 PM
Last Post: askfriends
  Visual Studio Code venv ibm_db error mesi1000 7 2,770 Nov-13-2022, 12:36 AM
Last Post: snippsat
  debugging help on Visual Studio Code mg24 12 1,988 Oct-02-2022, 12:18 AM
Last Post: mg24
  Problem with importing Python file in Visual Studio Code DXav 7 5,038 Jun-15-2022, 12:54 PM
Last Post: snippsat
  Showing an empty chart, then input data via function kgall89 0 971 Jun-02-2022, 01:53 AM
Last Post: kgall89
  Visual Studio Code Intellisense for Imported Modules Not Working hockinsk 1 2,697 Apr-23-2022, 04:41 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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