Re: [Tutor] question about operator overloading

2012-03-05 Thread Dave Angel
On 03/05/2012 06:20 PM, Alan Gauld wrote: On 05/03/12 21:25, Dave Angel wrote: It's not clear what __add__() should mean for physical files. My guess would be similar to the cat operator in Unix: $ cat file1, file2 > file3 is equivalent to file3 = file1 + file2 But of course, thats just m

Re: [Tutor] question about operator overloading

2012-03-05 Thread Steven D'Aprano
Alan Gauld wrote: On 05/03/12 21:25, Dave Angel wrote: It's not clear what __add__() should mean for physical files. My guess would be similar to the cat operator in Unix: $ cat file1, file2 > file3 is equivalent to file3 = file1 + file2 But of course, thats just my interpretation of file

Re: [Tutor] question about operator overloading

2012-03-05 Thread Joel Goldstick
On Mon, Mar 5, 2012 at 6:35 PM, Joel Goldstick wrote: > On Mon, Mar 5, 2012 at 6:20 PM, Alan Gauld wrote: >> On 05/03/12 21:25, Dave Angel wrote: >> >>> It's not clear what __add__() should mean for physical files. >> >> >> My guess would be similar to the cat operator in Unix: >> >> $ cat file1,

Re: [Tutor] question about operator overloading

2012-03-05 Thread Joel Goldstick
On Mon, Mar 5, 2012 at 6:20 PM, Alan Gauld wrote: > On 05/03/12 21:25, Dave Angel wrote: > >> It's not clear what __add__() should mean for physical files. > > > My guess would be similar to the cat operator in Unix: > > $ cat file1, file2 > file3 > > is equivalent to > > file3 = file1 + file2 > >

Re: [Tutor] question about operator overloading

2012-03-05 Thread Alan Gauld
On 05/03/12 21:25, Dave Angel wrote: It's not clear what __add__() should mean for physical files. My guess would be similar to the cat operator in Unix: $ cat file1, file2 > file3 is equivalent to file3 = file1 + file2 But of course, thats just my interpretation of file addition... -- Al

Re: [Tutor] question about operator overloading

2012-03-05 Thread Dave Angel
On 03/05/2012 04:10 PM, Albert-Jan Roskam wrote: Hi Dave, aha! Good thing I asked. ;-) I've indeed been thinking where this __add__ method should live. The program as it is now has a Generic class, a Reader class and a Writer class. I thought an Append class was appropriate because it uses Re

Re: [Tutor] question about operator overloading

2012-03-05 Thread Albert-Jan Roskam
Hi Dave, aha! Good thing I asked. ;-) I've indeed been thinking where this __add__ method should live. The program as it is now has a Generic class, a Reader class and a Writer class. I thought an Append class was appropriate because it uses Reader and Writer (and probably also Generic) methods

Re: [Tutor] question about operator overloading

2012-03-05 Thread Dave Angel
On 03/05/2012 03:16 PM, Albert-Jan Roskam wrote: Hi, I am extending a program for a hobby project where potentially huge spss files are read. I would like to add functionality to append files. I thought it would be nice and intuitive to overload + and += for this. The code below is a gross si

[Tutor] question about operator overloading

2012-03-05 Thread Albert-Jan Roskam
Hi, I am extending a program for a hobby project where potentially huge spss files are read. I would like to add functionality to append files. I thought it would be nice and intuitive to overload + and += for this. The code below is a gross simplification, but I want to get the basics right. I

Re: [Tutor] Question about writing to Excel with slavic characters

2012-03-05 Thread Albert-Jan Roskam
Hi, The R package foreign, in particular the read.spss function has some known problems reading spss system files. The memisc package also has a function to read .sav files. The big advantage of that function is that you can select rows and columns prior to actually reading the data into memory

Re: [Tutor] Blum blum shub pseudorandom generator

2012-03-05 Thread Walter Prins
Nivedita Steven D'Aprano wrote: > I'll do even better than send you working code for BBS -- I'll send you a > link to how you can find working code for nearly ANYTHING! > > https://duckduckgo.com/html/?q=download+%22blum+blum+shub%22&b= I'd like to just add to Steven's response and point out that

Re: [Tutor] Question about writing to Excel with slavic characters

2012-03-05 Thread Steven D'Aprano
Marko Limbek wrote: Thank you! That was easy. Now I have another problem. I use RPy and read the spss database with method read.spss inside a nested R code in Python, that looks like that: import rpy r(""" library(foreign) baza <- read.spss(""" + analysis[0] + """) print(baza$demo_izob0) """)

Re: [Tutor] Question about writing to Excel with slavic characters

2012-03-05 Thread Christian Witts
On 2012/03/05 03:05 PM, Marko Limbek wrote: Thank you! That was easy. Now I have another problem. I use RPy and read the spss database with method read.spss inside a nested R code in Python, that looks like that: import rpy r(""" library(foreign) baza<- read.spss(""" + analysis[0] + """) p

Re: [Tutor] Question about writing to Excel with slavic characters

2012-03-05 Thread Marko Limbek
Thank you! That was easy. Now I have another problem. I use RPy and read the spss database with method read.spss inside a nested R code in Python, that looks like that: import rpy r(""" library(foreign) baza <- read.spss(""" + analysis[0] + """) print(baza$demo_izob0) """) Now when my text

Re: [Tutor] Question about writing to Excel with slavic characters

2012-03-05 Thread Christian Witts
On 2012/03/05 02:37 PM, Marko Limbek wrote: Hi everyone. I am new to list and few months old to Python. I am writing some text to Excel and I open the new book and try to write to the book and the save it using book.save Now when I write slavic characters in the text to Excel (č, š, ž, for in

[Tutor] Question about writing to Excel with slavic characters

2012-03-05 Thread Marko Limbek
Hi everyone. I am new to list and few months old to Python. I am writing some text to Excel and I open the new book and try to write to the book and the save it using book.save Now when I write slavic characters in the text to Excel (č, š, ž, for instance 0xc5), I get an error, I can't save it.

Re: [Tutor] Blum blum shub pseudorandom generator

2012-03-05 Thread Steven D'Aprano
nivedita datta wrote: Hi, Can anyone send me a working code of BBS pseudorandom number generator. I'll do even better than send you working code for BBS -- I'll send you a link to how you can find working code for nearly ANYTHING! https://duckduckgo.com/html/?q=download+%22blum+blum+shub%22

Re: [Tutor] How to start with Glade.

2012-03-05 Thread Timo
Op 05-03-12 10:31, Ganesh Kumar schreef: Hi Guys, I am new to GUI, I know little bit python, But I do know, How to start with Glade and how to combine with .glade file to python. please guide me.. This is more of a question for the PyGTK mailing list. This is the bare minimum you need: impor

[Tutor] How to start with Glade.

2012-03-05 Thread Ganesh Kumar
Hi Guys, I am new to GUI, I know little bit python, But I do know, How to start with Glade and how to combine with .glade file to python. please guide me.. -Ganesh Did I learn something today? If not, I wasted it. ___ Tutor maillist - Tutor@python.or

Re: [Tutor] Blum blum shub pseudorandom generator

2012-03-05 Thread Alan Gauld
On 05/03/12 06:24, nivedita datta wrote: Hi, Can anyone send me a working code of BBS pseudorandom number generator. This list is for people learning the Python programming language. You might get lucky and someone has this code but you're far more likely to find somebody by posting on a more