Re: [Tutor] list.append(x) but at a specific 'i'

2010-09-21 Thread bob gailer
On 9/21/2010 6:30 PM, Norman Khine wrote: a = ['a', 'b', 'e'] >>> b = ['c', 'd'] i want to put the items of 'b' at [-2] for example. >>> a[-2:-2]=b >>> a ['a', 'c', 'd', 'b', 'e'] >>> -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist -

Re: [Tutor] Test Drive Development, DocTest, UnitTest

2010-09-21 Thread Steven D'Aprano
On Wed, 22 Sep 2010 01:37:42 am Tino Dai wrote: > I am > torn between the DocTest and UnitTest. I like the one "fileness" of > the DocTest, but am concerned > about the length of my tests being several orders of magnitude bigger > than the actual code. I > like the UnitTest having a separate file

Re: [Tutor] Getting/setting attributes

2010-09-21 Thread lists
>> As I understand it, it makes most sense to set/get the attribute of >> an object using a method rather than doing it directly. > > Heavens no!!! That's backwards! > > It might be justified in languages like Java, where you can't easily > change your mind about direct attribute access. There's al

Re: [Tutor] Getting/setting attributes

2010-09-21 Thread Vince Spicer
On Tue, Sep 21, 2010 at 4:16 PM, bob gailer wrote: > On 9/21/2010 5:06 PM, lists wrote: > >> Hi tutors, >> >> I'm trying to each myself programming and come from a background in >> system administration with some experience in scripting (so I'm very >> new to it). >> >> Currently I'm grappling w

Re: [Tutor] Getting/setting attributes

2010-09-21 Thread lists
> > My opinion - unless there is some verification or translation or action > required it is better (easier, clearer) to just access and assign the > attribute directly. This makes sense. I guess my current way of doing it just reflects my inexperience. At the moment I'm just fumbling this out so

[Tutor] list.append(x) but at a specific 'i'

2010-09-21 Thread Norman Khine
hello, how do i extend a python list but from a given [i], for example: >>> a = ['a', 'b', 'e'] >>> b = ['c', 'd'] >>> a + b ['a', 'b', 'e', 'c', 'd'] >>> but i want to put the items of 'b' at [-2] for example. thanks -- ˙uʍop ǝpısdn p,uɹnʇ pןɹoʍ ǝɥʇ ǝǝs noʎ 'ʇuǝɯɐן sǝɯıʇ ǝɥʇ puɐ 'ʇuǝʇuoɔ ǝq

Re: [Tutor] Getting/setting attributes

2010-09-21 Thread Steven D'Aprano
On Wed, 22 Sep 2010 07:06:50 am lists wrote: > As I understand it, it makes most sense to set/get the attribute of > an object using a method rather than doing it directly. Heavens no!!! That's backwards! It might be justified in languages like Java, where you can't easily change your mind abou

Re: [Tutor] Opening C++ binary files

2010-09-21 Thread Steven D'Aprano
On Wed, 22 Sep 2010 02:03:41 am Joe Bennett wrote: > I have some binary files created by a program written in C++... > Anyone have any experience with this and willing to share? ACSII test > is easy, but not sure how the rest is encoded What difference does the language the program was wri

Re: [Tutor] Getting/setting attributes

2010-09-21 Thread bob gailer
On 9/21/2010 5:06 PM, lists wrote: Hi tutors, I'm trying to each myself programming and come from a background in system administration with some experience in scripting (so I'm very new to it). Currently I'm grappling with the concept of object orientating programming and have a question abou

Re: [Tutor] Getting/setting attributes

2010-09-21 Thread lists
>> > Currently I'm grappling with the concept of object orientating >> >> Oops, just re-read that email. Anyone spot the obvious typo... Ahemmm >> of course I meant object orientated ;-) > > > Actually I believe you mean object *oriented*. > -Wayne Wow, spelling lessons too. And I thought this pla

Re: [Tutor] Getting/setting attributes

2010-09-21 Thread lists
> Currently I'm grappling with the concept of object orientating > programming and have a question about setting & getting attributes. Oops, just re-read that email. Anyone spot the obvious typo... Ahemmm of course I meant object orientated ;-) Chris __

Re: [Tutor] trouble with a small Tkinter example

2010-09-21 Thread Emile van Sebille
On 9/21/2010 1:50 PM Chuck Mayers said... Hello, I'm having trouble with this small example program: http://en.literateprograms.org/Bresenham%27s_line_algorithm_%28Python%29 When I run it, I only get a blank grey window. I'm running Python 2.6 under Windows XP. If there's a problem with the c

Re: [Tutor] trouble with a small Tkinter example

2010-09-21 Thread Chuck Mayers
There is a not-very-obvious 'Download Code' link at the very bottom of the article. Direct link: http://en.literateprograms.org/Special:Downloadcode/Bresenham%27s_line_algorithm_%28Python%29 On Tue, Sep 21, 2010 at 4:13 PM, Emile van Sebille wrote: > It looks like they've got you assembling t

Re: [Tutor] trouble with a small Tkinter example

2010-09-21 Thread Emile van Sebille
On 9/21/2010 1:50 PM Chuck Mayers said... Hello, I'm having trouble with this small example program: http://en.literateprograms.org/Bresenham%27s_line_algorithm_%28Python%29 When I run it, I only get a blank grey window. I'm running Python 2.6 under Windows XP. It looks like they've got you

Re: [Tutor] trouble with a small Tkinter example

2010-09-21 Thread Evert Rol
> I'm having trouble with this small example program: > > http://en.literateprograms.org/Bresenham%27s_line_algorithm_%28Python%29 > > When I run it, I only get a blank grey window. I'm running Python 2.6 under > Windows XP. > > If there's a problem with the code, I can't see it... it seems lik

[Tutor] Getting/setting attributes

2010-09-21 Thread lists
Hi tutors, I'm trying to each myself programming and come from a background in system administration with some experience in scripting (so I'm very new to it). Currently I'm grappling with the concept of object orientating programming and have a question about setting & getting attributes. As I

[Tutor] trouble with a small Tkinter example

2010-09-21 Thread Chuck Mayers
Hello, I'm having trouble with this small example program: http://en.literateprograms.org/Bresenham%27s_line_algorithm_%28Python%29 When I run it, I only get a blank grey window. I'm running Python 2.6 under Windows XP. If there's a problem with the code, I can't see it... it seems like it shou

Re: [Tutor] intercepting and recored I/O function calls

2010-09-21 Thread Jojo Mwebaze
I found this recipe quite related http://code.activestate.com/recipes/198078/ it logs all methods calls with their parameters and return values.. Can this be modified to include any other outputs of the module, which are not specified with the return statement. cheers On Fri, Sep 17, 2010 at

Re: [Tutor] Opening C++ binary files

2010-09-21 Thread Joel Goldstick
On Tue, Sep 21, 2010 at 1:23 PM, bob gailer wrote: > On 9/21/2010 12:34 PM, Joel Goldstick wrote: > > On Tue, Sep 21, 2010 at 12:03 PM, Joe Bennett wrote: >> >> I have some binary files created by a program written in C++... Anyone >> have any experience with this and willing to share? ACSII test

Re: [Tutor] Opening C++ binary files

2010-09-21 Thread Joel Goldstick
On Tue, Sep 21, 2010 at 1:23 PM, bob gailer wrote: > On 9/21/2010 12:34 PM, Joel Goldstick wrote: > > > > On Tue, Sep 21, 2010 at 12:03 PM, Joe Bennett wrote: > >> I have some binary files created by a program written in C++... Anyone >> have any experience with this and willing to share? ACSII

Re: [Tutor] Opening C++ binary files

2010-09-21 Thread bob gailer
On 9/21/2010 12:34 PM, Joel Goldstick wrote: On Tue, Sep 21, 2010 at 12:03 PM, Joe Bennett > wrote: I have some binary files created by a program written in C++... Anyone have any experience with this and willing to share? ACSII test is easy, but not

Re: [Tutor] Opening C++ binary files

2010-09-21 Thread Joel Goldstick
On Tue, Sep 21, 2010 at 12:03 PM, Joe Bennett wrote: > I have some binary files created by a program written in C++... Anyone > have any experience with this and willing to share? ACSII test is > easy, but not sure how the rest is encoded > > > > > -Joe > _

[Tutor] Opening C++ binary files

2010-09-21 Thread Joe Bennett
I have some binary files created by a program written in C++... Anyone have any experience with this and willing to share? ACSII test is easy, but not sure how the rest is encoded -Joe ___ Tutor maillist - Tutor@python.org To unsubscribe or

[Tutor] Test Drive Development, DocTest, UnitTest

2010-09-21 Thread Tino Dai
Hi All, In my journey from a hacker to a professional software developer, I have started to learn the finer points of Test Drive Development via Django (no questions about Django though). I am torn between the DocTest and UnitTest. I like the one "fileness" of the DocTest, but am concerned ab