<!DOCTYPE html>
<html><head>
<meta charset="UTF-8">
</head><body><p>Daryl.<br></p><p>Thanks. I have information about IDLE but haven't tried it. It would be good to go through some of the basics with you - I only need to get started - but that will have to wait for a while as I'm not at tomorrow's meeting.<br></p><p>Regards,<br></p><p>Nigel<br></p><blockquote type="cite">On 15 May 2019 at 10:56 Daryl via Nottingham <nottingham@mailman.lug.org.uk> wrote: <br> <br><div dir="ltr"><div>Nigel, <br></div><div><br></div><div>I should apologise too. I did read your email and was suggesting it might be easier to show you in person on Linux night than explain in email. I didn't however end up replying to your message, my fault. <br></div><div><br></div><div>Martin has of course explained it very well. There is also Python IDLE which is a very easy to use GUI that will be installable from the software/package manager on your Linux distribution of choice. Ensure the versions match though - I would always suggest using Python 3 for everything now.</div><div><br></div><div>I've been doing a LOT of Python development recently. I'm going to try and come along this Thursday (although no guarantee for reasons beyond my control) and happy to go through some things with you.</div><div> <br></div><div><br></div><div>Regards,</div><div>Daryl. <br></div></div><br><div class="ox-d3da3bea60-gmail_quote"><div dir="ltr" class="ox-d3da3bea60-gmail_attr">On Wed, 15 May 2019 at 10:24, Martin via Nottingham < <a href="mailto:nottingham@mailman.lug.org.uk">nottingham@mailman.lug.org.uk</a>> wrote: <br></div><blockquote>Nigel, <br> <br> Surprised none has come back to you on this one. Sorry for the slow <br> response! <br> <br> <br> We're over in Ye Olde Trip this Thursday for fun bits and pieces. Hope <br> you can make it! <br> <br> <br> For the Python bits, there's a few bits of syntax to follow... <br> <br> The ">>>" indicates that you are in a Python interpreter. To run script <br> files from that prompt, you need to do a few Python gymnastics! See: <br> <br> How to execute a file within the python interpreter? <br> <a href="https://stackoverflow.com/questions/1027714/how-to-execute-a-file-within-the-python-interpreter" target="_blank" rel="noopener">https://stackoverflow.com/questions/1027714/how-to-execute-a-file-within-the-python-interpreter</a> <br> <br> Another way is to format your script as a module and then "import" it <br> and execute the module... <br> <br> <br> For an example of running a python script from a *bash prompt* on my <br> machine for various versions of python, I get: <br> <br> ##### <br> <br> martin :) $ chmod +x hello_world.py <br> martin :) $ chmod +x hello_world.py.no_hash_pling <br> martin :) $ <br> martin :) $ ./hello_world.py <br> Hello World <br> martin :) $ ./hello_world.py.no_hash_pling <br> ./hello_world.py.no_hash_pling: line 5: syntax error near unexpected <br> token `'Hello World'' <br> ./hello_world.py.no_hash_pling: line 5: `print( 'Hello World' )' <br> martin :( $ <br> martin :( $ python ./hello_world.py <br> Hello World <br> martin :) $ python2 ./hello_world.py <br> Hello World <br> martin :) $ python3 ./hello_world.py <br> Hello World <br> martin :) $ python3.6 ./hello_world.py <br> Hello World <br> martin :) $ python hello_world.py.no_hash_pling <br> Hello World <br> martin :) $ python --version <br> Python 3.5.5 <br> martin :) $ python2 --version <br> Python 2.7.15 <br> martin :) $ python3 --version <br> Python 3.5.5 <br> martin :) $ python3.6 --version <br> Python 3.6.5 <br> martin :) $ <br> martin :) $ python2 <br> Python 2.7.15 (default, Sep 13 2018, 09:29:39) <br> [GCC 7.3.0] on linux2 <br> Type "help", "copyright", "credits" or "license" for more information. <br> >>> ./hello_world.py <br> File "<stdin>", line 1 <br> ./hello_world.py <br> ^ <br> SyntaxError: invalid syntax <br> >>> hello_world.py <br> Traceback (most recent call last): <br> File "<stdin>", line 1, in <module> <br> NameError: name 'hello_world' is not defined <br> >>> <br> martin :) $ python <br> Python 3.5.5 (default, Apr 18 2018, 13:08:30) <br> [GCC 6.4.0] on linux <br> Type "help", "copyright", "credits" or "license" for more information. <br> >>> hello_world.py <br> Traceback (most recent call last): <br> File "<stdin>", line 1, in <module> <br> NameError: name 'hello_world' is not defined <br> >>> <br> >>> exec(open("hello_world.py").read()) <br> Hello World <br> >>> <br> <br> ##### <br> <br> <br> The two files are attached for reference. <br> <br> <br> Hope that explains? <br> <br> Note also that in unix/linux, the filesystem and program names are case <br> sensitive! (As compared to the case insensitive world of Windows...). <br> <br> <br> Good luck! <br> <br> Cheers, <br> Martin <br> <br> <br> <br> On 12/05/2019 18:54, NIGEL Black via Nottingham wrote: <br> > <a href="mailto:nottingham@mailman.lug.org.uk" target="_blank" rel="noopener">nottingham@mailman.lug.org.uk</a> <br> > <br> >> ---------- Original Message ---------- <br> >> From: NIGEL Black < <a href="mailto:rnjblack@virginmedia.com" target="_blank" rel="noopener">rnjblack@virginmedia.com</a>> <br> >> To: <a href="mailto:mailman-owner@mailman.lug.org.uk" target="_blank" rel="noopener">mailman-owner@mailman.lug.org.uk</a> <br> >> Date: 10 May 2019 at 20:01 <br> >> Subject: Thursday 16 May <br> >> <br> >> Fellow Penguins, <br> >> <br> >> 1. I might not be at the next NLUG meeting so have attached a <br> >> reference on how to dual boot Linux mint and Windows 10. It might be <br> >> of particular interest to Boris. <br> >> <br> >> <a href="https://itsfoss.com/guide-install-linux-mint-16-dual-boot-windows/" target="_blank" rel="noopener">https://itsfoss.com/guide-install-linux-mint-16-dual-boot-windows/</a> <br> >> < <a href="https://itsfoss.com/guide-install-linux-mint-16-dual-boot-windows/" target="_blank" rel="noopener">https://itsfoss.com/guide-install-linux-mint-16-dual-boot-windows/</a>> <br> >> <br> >> 2. I've recently started on Python programming using version 3.6.7. <br> >> Calling up python3.6 on the terminal followed by <br> >> <br> >> >>>print( 'Hello Nigel' ) works. However the editor version saved as <br> >> "hello" in a folder called Python36 doesn't. <br> >> <br> >> >>> Python36 hello <br> >> File "<stdin>", line 1 <br> >> Python36 hello <br> >> ^ <br> >> <br> >> SyntaxError: invalid syntax <br> >> <br> >> Do I have to set up a path to Python36? My reference book doesn't <br> >> mention that. What exactly do I have to type to get this to work? <br> >> Any polite advice welcome. <br> >> <br> >> See you soon. <br> >> <br> >> Nigel <br> >> <br> > <br> > <br> > <br> > <br> <br> -- <br> Nottingham mailing list <br> <a href="mailto:Nottingham@mailman.lug.org.uk" target="_blank" rel="noopener">Nottingham@mailman.lug.org.uk</a> <br> <a href="https://mailman.lug.org.uk/mailman/listinfo/nottingham" target="_blank" rel="noopener">https://mailman.lug.org.uk/mailman/listinfo/nottingham</a><br></blockquote></div>-- <br>Nottingham mailing list <br>Nottingham@mailman.lug.org.uk <br>https://mailman.lug.org.uk/mailman/listinfo/nottingham</blockquote></body></html>