[Tutor] invalid syntax error in Run Run Module

Lisa Hasler Waters lwaters at flinthill.org
Thu Feb 18 13:28:45 EST 2016


Brilliant! Thanks so much. Makes perfect sense. Onward and upward then!

On Thu, Feb 18, 2016 at 1:16 PM, Alan Gauld <alan.gauld at btinternet.com>
wrote:

> On 18/02/16 14:10, Lisa Hasler Waters wrote:
> > Alan,
> >
> > Thank you so very much! This worked perfectly!
> >
> > Now, if you don't mind and you have the time, can you please elaborate
> > on when we (we being Python novices) would use the /Shell/ vs when it
> > is best to use the /Editor/?
> >
>
> You need to use the editor any time you want to create a file that you
> can run
> outside of IDLE. Especially for anything more than a dozen lines long - its
> much easier to edit in the editor than to try to recall all the lines
> you typed
> in the shell.
>
> The >>> prompt is for experimenting, trying out ideas. Running the help()
> command to read documentation etc. Anything interactive or temporary..
>
> I often find when I'm working on a project that I'll be entering my code in
> the editor but then want to find out how some module or function works.
> I then switch to the shell, try it out interactively and once I'm
> comfortable
> switch back to the editor to create the final code.
>
> Another thing the shell is good for is informal testing of modules. You can
> import them at the >>> prompt and then call the various functions/classes
> interactively.
>
> Of course eventually you will want to learn about how to formally test code
> too but for beginners the shell is often the best and most instructive and
> fun  way to start with testing.
>
> --
> Alan G
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/
> http://www.amazon.com/author/alan_gauld
> Follow my photo-blog on Flickr at:
> http://www.flickr.com/photos/alangauldphotos
>
>


-- 
Lisa Waters, PhD
Technology Integration
Flint Hill School


More information about the Tutor mailing list