Re: [Tutor] Problem Stripping

2012-04-01 Thread Steven D'Aprano
leam hall wrote: Python 2.4.3 on Red Hat 5. Trying to use strip to remove characters but it doesn't seem to work like I thought. res = subprocess.Popen(['uname', '-a'], stdout=subprocess.PIPE) uname = res.stdout.read().strip() For future reference, you should identify the shortest possible am

Re: [Tutor] breeds of Python .....

2012-04-01 Thread Barry Drake
On 01/04/12 18:16, Stefan Behnel wrote: I don't see a major reason for a beginner to not go straight for Python 3, and then learn the necessary Py2 quirks in addition when the need arises. Thanks for that. Really re-assuring. Also, I hadn't looked at 2to3 until you mentioned it - and certai

Re: [Tutor] breeds of Python .....

2012-04-01 Thread Stefan Behnel
Brett Ritter, 01.04.2012 07:19: > On Sat, Mar 31, 2012 at 5:37 PM, Barry Drake wrote: >> concentrate on Python3 or stay with Python2 and get into bad habits when it >> comes to change eventually? Apart from the print and input functions, I >> haven't so far got a lot to re-learn. > > My recommend

Re: [Tutor] breeds of Python .....

2012-04-01 Thread Barry Drake
On 01/04/12 16:57, Alan Gauld wrote: Oops, a slight mistake there it should be: int foo(a,b) int a; float b; { /* body here */ } Ah, now that rings bells It's all a very long time ago, but I think my Power-C was able to accept either format and not complain. I still have my Power-C ca

Re: [Tutor] breeds of Python .....

2012-04-01 Thread Alan Gauld
On 01/04/12 16:57, Alan Gauld wrote: On 01/04/12 16:34, Barry Drake wrote: different from the K&R specs. Interesting! A quick Google search threw up this useful PDF that does a tour of the "new" features of ANSI C and how best to use them. http://www.sascommunity.org/sugi/SUGI88/Sugi-13-229

Re: [Tutor] breeds of Python .....

2012-04-01 Thread Alan Gauld
On 01/04/12 16:34, Barry Drake wrote: On 01/04/12 15:26, Alan Gauld wrote: Actually the standardization of C sparked huge debates in the early 90's. There were lots of minor changes and one big style change that really polarised opinions. In traditional C you defined a functions parameters like

Re: [Tutor] breeds of Python .....

2012-04-01 Thread Barry Drake
On 01/04/12 15:26, Alan Gauld wrote: Actually the standardization of C sparked huge debates in the early 90's. There were lots of minor changes and one big style change that really polarised opinions. In traditional C you defined a functions parameters like int foo() int a; float b; { /* bod

Re: [Tutor] breeds of Python .....

2012-04-01 Thread Barry Drake
On 01/04/12 12:03, Leam Hall wrote: I believe PyGame is Python 3 ready so you've got an automatic hook for the kids. Heck, probably many of their parents as well! PyGame is available for Python3 but not pre-built from the Ubuntu or Debian repos as far as I can see. I got the source from the P

Re: [Tutor] breeds of Python .....

2012-04-01 Thread Alan Gauld
On 01/04/12 11:43, Barry Drake wrote: On 01/04/12 06:19, Brett Ritter wrote: is just a natural progression. I never experienced this with c as the standard library base on Kernighan and Ritchie never seemed to change its syntax from the word go. Actually the standardization of C sparked huge

Re: [Tutor] breeds of Python .....

2012-04-01 Thread Barry Drake
On 01/04/12 12:03, Leam Hall wrote: For that path I'd agree that Python 3 is the way to go. I believe PyGame is Python 3 ready so you've got an automatic hook for the kids. Heck, probably many of their parents as well! Check out the book "More Python programming for the absolute beginner" a

Re: [Tutor] breeds of Python .....

2012-04-01 Thread Barry Drake
On 01/04/12 06:19, Brett Ritter wrote: My recommendation is to go with Python2 - most major projects haven't made the switch and I'd expect another year or two before they do so. Many tutorials and examples are Python 2-based and there are not that many differences to unlearn in terms of habits