Hello, is it possible that you have a problem with different "line-ending characters"? Try the menu entry "convert end-of-line character" from the "source" menu before running your script. Make sure that you use "Mac" line-endings on the Mac and "Windows" line-endings on Windows.
Another possibility could be that you use TAB characters instead of spaces, and the TAB-width on different computers is different. Make sure that you use spaces only and no TAB characters. In the menu Tools->Preferences->Editor "Advanced settings" you should have "Indentation characters: 4 spaces" selected. Regards: Uwe Fechner On Monday, June 24, 2013 1:45:53 AM UTC+2, Stew Day wrote: > > Hi group, > > I learned some python quite a while ago and have decided to revisit it as > a tool for statistical analysis. > > I installed Python(x, y) on my work machine last week (Windows XP) and, > after some playing around it looks like things are working (am able to run > example scripts from Allen Downey's free book ThinkPython in Spyder). > > At home I run an old MacBook (OSX 10.6.8) so I have installed the Anaconda > distribution. Once again, it looked like everything was working correctly. > > So, I copied all the examples files and pdf of ThinkPython to a USB key so > that whether I'm at home, at work or on the train, I can work through the > example and get myself back up to speed with python. > > When I tried to run write/run 'hello world' this morning on the train > (OSX) I got the following error: > > File "<stdin>", line 1 > SyntaxError: 'continue' not properly in loop > > I got to work, loaded up Spyder and tried to run the same HelloWorld.py > and got the same error. I also tried running some of the other scripts I > was playing with last week and got the same error even those these scripts > had previously run. > > I still have PyScripter on my work machine, so ran HelloWorld.py using > PyScripter and got Hello world at the console. > > If I run debug on HelloWorld.py from Spyder I get: > >>> debugfile(r'E:\Programming\Python\ThinkPython\HelloWorld.py', > wdir=r'E:\Programming\Python\ThinkPython') > > e:\programming\python\thinkpython\helloworld.py(5)<module>() > -> """ > (Pdb) > > (with a flashing command prompt after (Pdb)) > > If I then run HelloWorld.py I get: > (Pdb) continue > Hello world > >>> > > But subsequent runs give the initial error. > > I'm assuming this is related to Spyder, as I can run the same scripts in > PyScipter without error. > > Hope someone can help (apologies in advance if this is a newbie error). > -- You received this message because you are subscribed to the Google Groups "spyder" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/spyderlib. For more options, visit https://groups.google.com/groups/opt_out.
