Re: [Tutor] Best version for novice
On 02/01/2014 03:35 PM, Alan Gauld wrote: On 01/02/14 18:41, Ian D wrote: Is it better to use python 3 as a newcomer who isn't really going to be writing any software as such just using it for learning? The more important question is which version does your preferred tutorial use? And are you targeting a specific platform or just for yourself? Some platforms, like Red Hat/CentOS, are still 2.x. The most current RHEL is 2.6 and the upcoming RHEL 7 is still Python 2.7. If you're doing this for yourself, or for a start-up that can use newer versions, use 3.x if your tutorial supports it. You might note in Alan's signature is a like to his site, which happens to have a nice tutorial. :) http://www.alan-g.me.uk/ Leam -- http://31challenge.net http://31challenge.net/insight ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Best version for novice
On 14-02-01 08:20 PM, Steven D'Aprano wrote: On Sat, Feb 01, 2014 at 06:41:10PM +, Ian D wrote: Hi Is it better to use python 3 as a newcomer who isn't really going to be writing any software as such just using it for learning? Yes, you should use Python 3, with one proviso: many tutorials, especially the older ones, are based on Python 2. That means that you Steven is not a newbie, but I am. I suppose that makes me the expert on tutorials, LOL. I find that most useful tut are now for Python 3, when you find a Python 2 tutorial you need to convert the print statement, the tkinter import statement, and ignore any references to cPickle. In my experience everything else works as posted. PierreD. either need to find another tutorial, or mentally adjust from Python 2 to 3 when you read it. That's easy for an experienced user, but perhaps not for a beginner. The differences aren't really that great, no more different than between (say) British English and American English, but it may be disconcerting for somebody who isn't confident with the language. Python 3 is the future of Python. All improvements are going into 3, 2 is only getting bug fixes. If you aren't *required* to stick with Python 2 for some reason, you should use 3. Also in 2.7 I use no subprocess by giving my python exe a -n argument, otherwise my canvas program's freeze. I'm afraid that I have no idea what you are talking about here, Python doesn't accept a -n argument: [steve@ando ~]$ python2.7 -n Unknown option: -n usage: python2.7 [option] ... [-c cmd | -m mod | file | -] [arg] ... Try `python -h' for more information. Regards, ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
[Tutor] Best version for novice
Hi Is it better to use python 3 as a newcomer who isn't really going to be writing any software as such just using it for learning? Also in 2.7 I use no subprocess by giving my python exe a -n argument, otherwise my canvas program's freeze. Is this needed also in version 3? Ta ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Best version for novice
On 01/02/14 18:41, Ian D wrote: Is it better to use python 3 as a newcomer who isn't really going to be writing any software as such just using it for learning? The more important question is which version does your preferred tutorial use? Both versions will teach you a lot about programming and Python, but the tutorial that suits your style of learning best will most likely determine the version you use since its harder to learn when the examples don't work! Although some might argue that fixing them teaches you even more! Also in 2.7 I use no subprocess by giving my python exe a -n argument, otherwise my canvas program's freeze. I don;t need to do that in any of my Python versions. Are you by any chance running your code in IDLE? There used to be issues with idle and subprocesses and Tkinter. But I thought they'd all been fixed by 2.7... HTH -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.flickr.com/photos/alangauldphotos ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Best version for novice
On Sat, Feb 01, 2014 at 06:41:10PM +, Ian D wrote: Hi Is it better to use python 3 as a newcomer who isn't really going to be writing any software as such just using it for learning? Yes, you should use Python 3, with one proviso: many tutorials, especially the older ones, are based on Python 2. That means that you either need to find another tutorial, or mentally adjust from Python 2 to 3 when you read it. That's easy for an experienced user, but perhaps not for a beginner. The differences aren't really that great, no more different than between (say) British English and American English, but it may be disconcerting for somebody who isn't confident with the language. Python 3 is the future of Python. All improvements are going into 3, 2 is only getting bug fixes. If you aren't *required* to stick with Python 2 for some reason, you should use 3. Also in 2.7 I use no subprocess by giving my python exe a -n argument, otherwise my canvas program's freeze. I'm afraid that I have no idea what you are talking about here, Python doesn't accept a -n argument: [steve@ando ~]$ python2.7 -n Unknown option: -n usage: python2.7 [option] ... [-c cmd | -m mod | file | -] [arg] ... Try `python -h' for more information. Regards, -- Steven ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Best version for novice
On Sat, Feb 1, 2014 at 8:20 PM, Steven D'Aprano st...@pearwood.info wrote: I'm afraid that I have no idea what you are talking about here, Python doesn't accept a -n argument: -n is an IDLE option: If IDLE is started with the -n command line switch it will run in a single process and will not create the subprocess which runs the RPC Python execution server. This can be useful if Python cannot create the subprocess or the RPC socket interface on your platform. However, in this mode user code is not isolated from IDLE itself. Also, the environment is not restarted when Run/Run Module (F5) is selected. If your code has been modified, you must reload() the affected modules and re-import any specific items (e.g. from foo import baz) if the changes are to take effect. For these reasons, it is preferable to run IDLE with the default subprocess if at all possible. With respect to Tkinter, using -n allows your widgets to piggyback on IDLE's main loop. I looked into this a bit: In a terminal you usually don't have to manually `update` [1] the embedded Tcl interpreter's event queue. What happens is the _tkinter extension module sets the global function pointer PyOS_InputHook to a function that calls Tcl_DoOneEvent [2]. The readline module calls this hook about 10 times per second while waiting for input. However, readline isn't used for IDLE's child process, which gets code from a socket in a background thread. [1] http://www.tcl.tk/man/tcl8.5/TclCmd/update.htm [2] http://www.tcl.tk/man/tcl8.5/TclLib/DoOneEvent.htm ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor