appending into a list; dictionary and list

Tim Chase python.list at tim.thechases.com
Tue Oct 30 08:54:42 EDT 2007


>    A                     B              C                     D       E
[snipped yet another column of random data]
> I need to append the column D and E into a list:
>                             in such a way that the list should have
> [D,E,D,E,D,E........]
> How do i do it.

You start by writing some code[1].  I recommend Python, as it's a 
wonderful language, easy to learn, easy to read, has lots of 
example code, and the folks on this mailing list are ever so 
helpful (as shown by answering your last umpteen questions for 
which you seem to have not demonstrated a whit of effort towards 
solving yourself).  However, as you're doing lots of text 
manipulations, I've heard Perl and Awk are also good at that sort 
of thing[2].

Then once you've written your code, if you have problems with it, 
you ask questions here on the list.  Post the germane snippet of 
code that isn't working quite the way you expected, along with a 
detailed description of the problem.  Perhaps, if you get an 
exception traceback, you include the whole traceback.[3]

-tkc

[1] Writing code is a difficult thing to do and success may be 
limited to people with an aptitude for the thought process.  If 
programming confounds you, you may want to read any of the 
readily available texts on how to program[4], take a class on the 
topic, or you may need to hire somebody to write the code for you.

[2]  I occasionally do Awk, but try to avoid Perl to the best of 
my abilities.

[3] http://catb.org/~esr/faqs/smart-questions.html

[4] Resources include:
http://docs.python.org/
http://diveintopython.org/toc/index.html
http://aspn.activestate.com/ASPN/Cookbook/Python
http://gnosis.cx/TPiP/
http://www.handysoftware.com/cpif/
http://ppython.com/
http://www.google.com/search?q=learn%20python



More information about the Python-list mailing list