On Wed, Apr 06, 2005 at 03:30:41PM -0700, RickMuller wrote:
> I have to sort a list, but in addition to the sorting, I need to
> compute a phase factor that is +1 if there is an even number of
> interchanges in the sort, and -1 if there is an odd number of
> interchanges.
>
I would just write a
On Tue, Mar 01, 2005 at 01:27:27PM +0100, Tor Erik S?nvisen wrote:
> Hi
>
> How can I read the first line of a file and then delete this line, so that
> line 2 is line 1 on next read?
>
> regards
>
>
I think you can do something like:
n=false
f=file.open("") #stuff here
g=[]
for line in f.re
On Wed, Feb 02, 2005 at 11:47:41PM -0500, Caleb Hattingh wrote:
> Hi Alex
>
> Assuming you have a file called "data.txt":
>
> ***
> f = open('data.txt','r')
> lines = f.readlines()
> f.close()
> for line in lines:
> print line
> ***
>
Can you not write this:
f=open("data.txt", "r")
for line
On Tuesday 25 Jan 2005 17:50, Dan Perl wrote:
> I was wrong. He is just crossposting to the newsgroups without having
> them as members of the group.
>
> I wish there was a good way like that to stop these daily postings!
>
You can just filter on [perl-python]
Pete
--
http://mail.python.org/mai
On Tuesday 21 Dec 2004 11:24, Rameshwari wrote:
> Hi,
>
> I would like to read a ms-word document using python.
>
> Basically the word document contains number of tables and the rows
> in each table do not have same number of columns.
>
> Does anyone have a sample code to read a table?
>
> Thank y
On Monday 20 Dec 2004 22:44, Anders Andersson wrote:
> Hello
>
> I want to concatinate (I apologize for bad English, but it is not my
> native language) a list of strings to a string. I could use (I think):
>
> s = ""
> map(lambda x: s.append(x), theList)
>
> But I want to do something like (I thin
On Monday 20 Dec 2004 03:58, banaticus wrote:
> What does this error message mean? What can I do to fix it?
>
> Here'e the command that I just tried running, and the messages that
> I received. I just barely unpacked python.
>
> linux:/Python-2.4 # ./configure
> checking MACHDEP... linux2
> check
like this:
def flatten(nested):
for sublist in nested:
for element in sublist:
yield element
n=[['N', 'F'], ['E'], ['D']]
output=[]
for value in flatten(n):
output.append(value)
print output
Have a merry Christmas
Peter Nuttall
--
http://mail.python.org/mailman/listinfo/python-list