Re: [Tutor] overriding instance attributes with keywords

2012-08-13 Thread Steven D'Aprano
On 14/08/12 07:16, eryksun wrote: On Mon, Aug 13, 2012 at 3:13 PM, Gregory, Matthew wrote: I'm trying to create a new instance from an existing instance def new_with_overrides(s1, **kwargs): new_params = {'a': s1.a, 'b': s1.b} for (k, v) in kwargs.iteritems(): if k in ne

Re: [Tutor] output not in ANSI

2012-08-13 Thread Steven D'Aprano
On 14/08/12 04:04, Joel Goldstick wrote: On Mon, Aug 13, 2012 at 1:58 PM, Alan Gauld wrote: On 13/08/12 16:01, leon zaat wrote: I wrote a program for creating a csv file. I am using pyton on windows. The output i get is not in ANSI. Can you clarify what you mean by ANSI? According to Wikip

Re: [Tutor] output not in ANSI

2012-08-13 Thread Alan Gauld
On 13/08/12 18:58, Alan Gauld wrote: Locale will affect the display of the data in terms of fonts and such. Is that what you are trying to control? For font read character set, oops! :-( -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ __

Re: [Tutor] output not in ANSI

2012-08-13 Thread Walter Prins
On 13 August 2012 20:12, eryksun wrote: > In Windows, ANSI refers to the locale-dependent 8-bit codepage. But > there is no ANSI standard for Windows1252. It's a common misnomer in > the OS dialog boxes and controls. Yes. In case it adds anything to the discussion, here's a page that documents t

Re: [Tutor] overriding instance attributes with keywords

2012-08-13 Thread eryksun
On Mon, Aug 13, 2012 at 3:13 PM, Gregory, Matthew wrote: > > I'm trying to create a new instance from an existing instance > def new_with_overrides(s1, **kwargs): > new_params = {'a': s1.a, 'b': s1.b} > for (k, v) in kwargs.iteritems(): > if k in new_params: > new_para

[Tutor] overriding instance attributes with keywords

2012-08-13 Thread Gregory, Matthew
Hi all, I'm trying to create a new instance from an existing instance with attributes of the new instance allowed to be overwritten by keyword parameters. I'm guessing I'm not doing this in the most efficient manner. class Spam: def __init__(self, a, b): self.a = a self.b =

Re: [Tutor] output not in ANSI

2012-08-13 Thread eryksun
On Mon, Aug 13, 2012 at 2:04 PM, Joel Goldstick wrote: > > I believe in this context the OP means ASCII. ASCII became an ANSI > recognized standard many years ago In Windows, ANSI refers to the locale-dependent 8-bit codepage. But there is no ANSI standard for Windows1252. It's a common misnomer

Re: [Tutor] output not in ANSI

2012-08-13 Thread Jerry Hill
On Mon, Aug 13, 2012 at 11:01 AM, leon zaat wrote: > I wrote a program for creating a csv file. > I am using pyton on windows. > The output i get is not in ANSI. I'm not familiar with an encoding that would be called ANSI, or any ANSI specification for CSV files. What, exactly, are you looking f

Re: [Tutor] output not in ANSI

2012-08-13 Thread Joel Goldstick
On Mon, Aug 13, 2012 at 1:58 PM, Alan Gauld wrote: > On 13/08/12 16:01, leon zaat wrote: >> >> I wrote a program for creating a csv file. >> I am using pyton on windows. >> The output i get is not in ANSI. > > > Can you clarify what you mean by ANSI? According to Wikipedia: > I believe in this con

Re: [Tutor] output not in ANSI

2012-08-13 Thread Alan Gauld
On 13/08/12 16:01, leon zaat wrote: I wrote a program for creating a csv file. I am using pyton on windows. The output i get is not in ANSI. Can you clarify what you mean by ANSI? According to Wikipedia: The Institute administers five standards panels: The ANSI Biofuels St

[Tutor] output not in ANSI

2012-08-13 Thread leon zaat
I wrote a program for creating a csv file. I am using pyton on windows. The output i get is not in ANSI. Is there a way i can get the output in ansi, I imported locale and tried wb and w as type of writing. ofile=open(r'D:\bestanden\BAG\adrescoordinaten.csv', 'w(b)')

[Tutor] Matching 3 tables with almost identical columns

2012-08-13 Thread Elaina Ann Hyde
Greetings, I have a rather monolithic database I am re-building at the moment, and I want to join 3 tables with semi-matching content, I have several sets of these but they all come in groups of three. Here is the situation: --note all tables are in ascii format, space deliminated, with readab