Re: I'm a newbie and I'm stumped...
On Saturday, August 1, 2015 at 11:59:14 AM UTC-4, Dwight GoldWinde wrote: Please help. I am running Python 3.4 on my Mac mini, OS X 10.10.2, using Coderunner 2 as my editor. Here's the code: #!/usr/bin/env python3 word = (input('Enter a word ')) When running this inside of Coderunner, I get the follow error, after entering the word 'serendipity': Enter a word serendipity Traceback (most recent call last): File test short.py, line 2, in module word = (input('Enter a word ')) File string, line 1, in module NameError: name 'serendipity' is not defined If you want to run this in Python 3, try this CodeRunner-Preferences-Languages-Run Command edit python $filename to python3 $filename It appears coderunner 2 is using Python 2.7.1 Here's where I found the answer, from someone who had a similar issue. Please let us know either way if it solved the problem. http://stackoverflow.com/questions/19797616/coderunner-uses-old-2-71-version-of-python-instead-of-3-2-on-osx-10-7-5 -- https://mail.python.org/mailman/listinfo/python-list
Re: I'm a newbie and I'm stumped...
On Thu, Jul 30, 2015 at 9:22 PM, Dwight GoldWinde dwi...@goldwinde.com wrote: Please help. I am running Python 3.4 on my Mac mini, OS X 10.10.2, using Coderunner 2 as my editor. Here’s the code: #!/usr/bin/env python3 word = (input('Enter a word ‘)) When running this inside of Coderunner, I get the follow error, after entering the word ‘serendipity’: Enter a word serendipity Traceback (most recent call last): File test short.py, line 2, in module word = (input('Enter a word ')) File string, line 1, in module NameError: name 'serendipity' is not defined The error you are getting is the error you would get if you were using python 2.x. So, are you sure you are running 3.4? Can you go to a shell and run it from command line? also, use plain text to send mail -- https://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list
Re: I'm a newbie and I'm stumped...
On 7/30/2015 9:22 PM, Dwight GoldWinde wrote: Please help. I am running Python 3.4 on my Mac mini, OS X 10.10.2, using Coderunner 2 as my editor. Here’s the code: #!/usr/bin/env python3 word = (input('Enter a word ‘)) The outer parentheses are not needed. Ditto to the other comments, especially about not using html and the unicode quote that causes SyntaxError. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list
Re: I'm a newbie and I'm stumped...
On 7/30/2015 6:22 PM, Dwight GoldWinde wrote: I am running Python 3.4 on my Mac mini, OS X 10.10.2, using Coderunner 2 as my editor. Here¹s the code: #!/usr/bin/env python3 word = (input('Enter a word Œ)) When running this inside of Coderunner, I get the follow error, after entering the word Œserendipity¹: Enter a word serendipity Traceback (most recent call last): File test short.py, line 2, in module word = (input('Enter a word ')) File string, line 1, in module NameError: name 'serendipity' is not defined I'd look at which python is actually running (sys.version): Python 3.4.0 (default, Apr 11 2014, 13:05:11) [GCC 4.8.2] on linux Type help, copyright, credits or license for more information. word = (input('enter a word ')) enter a word test emile@emile-OptiPlex-9010:~$ python Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type help, copyright, credits or license for more information. word = (input('enter a word ')) enter a word test Traceback (most recent call last): Emile File stdin, line 1, in module File string, line 1, in module NameError: name 'test' is not defined -- https://mail.python.org/mailman/listinfo/python-list
Re: I'm a newbie and I'm stumped...
On 31-07-2015 02:22, Dwight GoldWinde wrote: Please help. I am running Python 3.4 on my Mac mini, OS X 10.10.2, using Coderunner 2 as my editor. Here’s the code: #!/usr/bin/env python3 word = (input('Enter a word ‘)) As is here, this code should raise a syntax error message like SyntaxError: EOL while scanning string literal On the right side of *Enter a word* you have to use the same single quote ' as that on the left side. Besides this, the code must work assigning your string input to variable word. The outer () are unnecessary but cause no hurt. -- https://mail.python.org/mailman/listinfo/python-list