Re: [Tutor] Fwd: script in Raspberry pi python

2013-07-29 Thread Kirk Bailey
ok, I read linked article, then copied the perl script text, which bombs. The TEXT: * #!/usr/local/bin/perl -w** ** use strict;** ** ** while () {** ** s/\r\n/\n/;** ** print;** ** }* This works nicely, and all problems are solved. I tried to download the program using apt-get, b

Re: [Tutor] Fwd: script in Raspberry pi python

2013-07-29 Thread Kirk Bailey
originally edited on a windows box, then copied over with a usb stick. I suppose I better open it, copy it to mouse then paste it to a nw file- or what? Please advise. On 7/25/2013 3:45 PM, Walter Prins wrote: Hi, On 25 July 2013 19:45, Kirk Bailey > wrote

Re: [Tutor] 2.x and 3.x in one code base [was Re: PYTHONHASHSEED, -R]

2013-07-29 Thread Alan Gauld
On 29/07/13 22:08, Albert-Jan Roskam wrote: All the way back to Python 2.4? It seems frustrating not to > be able not to use all the nice goodies added in later versions. ... > just my personal annoyance with our software in the office > which is always emm, not quite up to date). Using latest

Re: [Tutor] Shared State

2013-07-29 Thread Alan Gauld
On 29/07/13 19:30, wolfrage8...@gmail.com wrote: I want to learn to program in a more functional manor, in fact I am now reading a book on Erlang, but I still mostly program in Python. I want to know how you reduce side-effects in a GUI program, and further how you handle side effects when you

[Tutor] 2.x and 3.x in one code base [was Re: PYTHONHASHSEED, -R]

2013-07-29 Thread Steven D'Aprano
On 29/07/13 19:29, Albert-Jan Roskam wrote: The following question is almost new-thread-worthy, but: if I would like to make my app work for 2.x and 3.x, what is the best approach: (a) use "if sys.version_info.major" throughout the code (b) use 2to3, hope for the best and fix manually whatev

Re: [Tutor] PYTHONHASHSEED, -R

2013-07-29 Thread Steven D'Aprano
On 29/07/13 19:29, Albert-Jan Roskam wrote: The dict isn't changing state, So that's the criterion! Thanks! So as long as you don't use __setitem__ and __delitem__ (maybe also __setattribute__, __delattribute__, ...) the state does not change. Built-in dicts cannot take extra attributes:

Re: [Tutor] script in Raspberry pi python

2013-07-29 Thread Francois Dion
Dont edit unix files on windows, else you might end up with that problem. It is looking for python^M and not python. Edit with vi and delete the control-M character. Also, If you need to edit a file with a GUI but have the raspberry pi headless check out: http://raspberry-python.blogspot.com/2