none
VStudio and Pyton Tools

    Question

  • Hello,

    I was attempting to duplicate the instructors name = input  and then print the variable, however I get an error directly after i enter the name.

    What is your name?matt
    Traceback (most recent call last):
      File "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Python Tools for Visual Studio\2.1\visualstudio_py_util.py", line 1
    06, in exec_file

        exec_code(code, file, global_variables)
      File "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Python Tools for Visual Studio\2.1\visualstudio_py_util.py", line 8
    2, in exec_code
        exec(code_obj, global_variables)
      File "\\xxxxxx\private\xxxxxxxx\my documents\visual studio 2013\Projects\Strings Variables\Strings Variables\Strings_Variables.py", line 2, in <mod
    ule>
        name = input ("What is your name?")
      File "<string>", line 1, in <module>
    NameError: name 'matt' is not defined
    Press any key to continue . . .

    ???????????????  any ideas?

    using Python278

    Matt

    Tuesday, December 16, 2014 11:41 PM

Answers

All replies

  • Can you please share the complete Python source code you wrote?

    That will help others understand the issue and help you.

    Thanks.

    Wednesday, December 17, 2014 12:11 AM
  • Hi Matt,

    What about your issue now?

    If you have resolved it, you can share the solution here, which will be beneficial for other members with the same issue.

    Actually your issue is out of support range of VS General Question forum which mainly discusses the usage of Visual Studio IDE such as WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System and Visual Studio Editor. It would be better if you can provide us more information.

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, December 22, 2014 5:40 AM
  • You probably want to try a Python forum:

    http://www.bing.com/search?q=python+forum

    Thanks!


    Ed Price, Azure & Power BI Customer Program Manager (Blog, Small Basic, Wiki Ninjas, Wiki)

    Answer an interesting question? Create a wiki article about it!

    Wednesday, December 31, 2014 1:43 AM
    Owner
  • you can remove this post, the I have given up on trying to make this work.  I have tried several installs, computers and all with the same result.  this was something I was going to play around with and now do not have the time. 

    thank you all for your efforts thus far.  please remove post.

    M

    Tuesday, January 13, 2015 3:41 PM
  • If you have installed Python 2.x, you would have to replace "input" by "raw_input". In the course they obviously use Python 3.x though. In your case just try to run this with "raw_input" instead.

    To enable Python 3.4 as your default version go to "Tools - Python Tools - Python Environments" and make Python 3.4 the default.

    Greets, Luco



    • Edited by lucobada Friday, May 29, 2015 2:54 PM
    Friday, May 29, 2015 2:50 PM
  • If you have installed Python 2.x, you would have to replace "input" by "raw_input". In the course they obviously use Python 3.x though. In your case just try to run this with "raw_input" instead.

    To enable Python 3.4 as your default version go to "Tools - Python Tools - Python Environments" and make Python 3.4 the default.
    Friday, May 29, 2015 2:56 PM