As far as I know there is no official way to clone a list in Python. This is desirable at times because normal variable assignment of lists is just a reference copy. For example:
>>> listA = [’A', ‘B’, ‘C’, ‘D’]
>>> listB = listA
>>> listA
[’A', ‘B’, ‘C’, ‘D’]
>>> listB
[’A', ‘B’, ‘C’, ‘D’]
>>> listA.remove(’C')
>>> listA
[’A', [...]
Entries Categorized as 'Python'
Cloning a List in Python
April 14, 2008 by Isaac
How to Use JPype
March 31, 2008 by Isaac
Background
I love Python and my personal experience has shown that testers are about 4x more productive when using Python than when using Java. However, at work I am a tester on a Java application. I’ve been looking for a way to bridge that gap and allow me to write my tests in Python [...]
Python Dataflow Programming
March 27, 2008 by Isaac
Dataflow programming is something new to me. Lately I’ve been looking up articles and information about this programming paradigm. In a sense I suppose that I am familiar with the concepts. In Linux I use the pipe “|” a lot to pump data from one program to another. Each program in the stage alters the [...]
Creating PDF’s in Python
July 25, 2006 by Isaac
Whatever your role or occupation there are doubtless times where you need to write a report. Most of the reports that I turn in are unique and need to be manually generated. However, my weekly test status report is pretty much the same every week and basically its just the stats that change.
Poking [...]
Results Comparison in PyFIT Fixtures
June 26, 2006 by Isaac
I’m not sure if this is the intended behavior or not, but I found a “feature” in PyFIT that had me smashing the keyboard with my face. According to the PyFIT documentation you should be able to create a table like this:
|TestClass|
|InputString |OutputNum |
|Hello World [...]
Running FitNesse tests from the command line with PyFIT
June 21, 2006 by Isaac
I’m really starting to get into this whole FIT/FitNesse thing. Creating test cases is now easy and my managers love the HTML documentation and results that come out of the tools. Until now I’ve just been using FitNesse, but thanks to the hard work of Grig Gheorghiu and John Roth (the PyFIT author) [...]
Bit by Unicode
June 21, 2006 by Isaac
I was pretty proud of my latest Python script, which was designed to test a CORBA object. However, when I tried to run the script it gave me some obfuscated errors and died. So, for the last couple days I’ve been trying to figure out why my script was dying. It turns [...]
Using fixtures from within a SequenceFixture
June 12, 2006 by Isaac
The FIT SequenceFixture is essentially the same as a DoFixture. I just like the way commands are written better. One of the cool things about a SequenceFixture (or DoFixture) is that it allows you to use other fixture types from within. So, you could have a RowFixture running some tests then decide [...]
What not to do when importing Python modules
May 24, 2006 by Isaac
Let’s see, this would be stupid mistake number 23,320,594,283 for me so far this year….
If you haven’t yet discovered it, IPython is the greatest thing since sliced bread. Come to think of it, I think it’s better than sliced bread. Anyway, in my typical Python development cycle I have one console open with [...]
Posted in

content rss
