Gabriel Genellina 写道:
> En Tue, 22 Jan 2008 02:03:10 -0200, Paul Rubin
> <"http://phr.cx"@NOSPAM.invalid> escribió:
>
>> "J. Peng" <[EMAIL PROTECTED]> writes:
>>> print line,
>> Do you really want all the lines crunched together like that? If not,
>> leave off the comma.
>
> Remember t
En Tue, 22 Jan 2008 02:03:10 -0200, Paul Rubin
<"http://phr.cx"@NOSPAM.invalid> escribió:
> "J. Peng" <[EMAIL PROTECTED]> writes:
>> print line,
>
> Do you really want all the lines crunched together like that? If not,
> leave off the comma.
Remember that Python *keeps* the end-of-line
Thank you. That gave so much solutions.
And thanks all.
Steven D'Aprano 写道:
> On Tue, 22 Jan 2008 11:00:53 +0800, J. Peng wrote:
>
>> first I know this is the correct method to read and print a file:
>>
>> fd = open("/etc/sysctl.conf")
>> done=0
>> while not done:
>> line = fd.readline()
>>
"J. Peng" <[EMAIL PROTECTED]> writes:
> print line,
Do you really want all the lines crunched together like that? If not,
leave off the comma.
> I dont like that flag of "done",then I tried to re-write it as:
>
> fd = open("/etc/sysctl.conf")
> while line = fd.readline():
> print li
On Tue, 22 Jan 2008 11:00:53 +0800, J. Peng wrote:
> first I know this is the correct method to read and print a file:
>
> fd = open("/etc/sysctl.conf")
> done=0
> while not done:
> line = fd.readline()
> if line == '':
> done = 1
> else:
> print line,
>
> fd.close()
On Jan 21, 9:08 pm, Mel <[EMAIL PROTECTED]> wrote:
> J. Peng wrote:
> > first I know this is the correct method to read and print a file:
>
> > fd = open("/etc/sysctl.conf")
> > done=0
> > while not done:
> > line = fd.readline()
> > if line == '':
> > done = 1
> > else:
> >
J. Peng wrote:
> first I know this is the correct method to read and print a file:
>
> fd = open("/etc/sysctl.conf")
> done=0
> while not done:
> line = fd.readline()
> if line == '':
> done = 1
> else:
> print line,
>
> fd.close()
>
>
> I dont like that flag of "don
You might could do one of these two methods:
fd.readlines()
or:
for line in fd:
print line
These are both from the Python tutorial found here:
http://docs.python.org/tut/node9.html#SECTION00921
/alex
On Jan 21, 2008 9:00 PM, J. Peng <[EMAIL PROTECTED]> wrote:
> first I kno
first I know this is the correct method to read and print a file:
fd = open("/etc/sysctl.conf")
done=0
while not done:
line = fd.readline()
if line == '':
done = 1
else:
print line,
fd.close()
I dont like that flag of "done",then I tried to re-write it as:
fd = open
Everything is fine now, thanks to all for your time
--
http://mail.python.org/mailman/listinfo/python-list
You may also be interested in the biopython project:
http://www.biopython.org/
tom
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
#!/cbi/prg/python/current/bin/python
# -*- coding: iso-8859-1 -*-
import sys
import os
from progadn import *
...
for x in extseq:
f = open(x, "r")
seq=f.read()
f.close()
s=seq
def checkDNA(seq):
...
seq=checkDNA(seq)
print seq
You terminated the loop
<[EMAIL PROTECTED]> wrote:
> I am new to python and I am not in computer science. In fact I am a
biologist and I ma trying to learn python. So if someone can help me, I
will appreciate it.
> Thanks
>
>
> #!/cbi/prg/python/current/bin/python
> # -*- coding: iso-8859-1 -*-
> import sys
> import os
>
I am new to python and I am not in computer science. In fact I am a biologist
and I ma trying to learn python. So if someone can help me, I will appreciate
it.
Thanks
#!/cbi/prg/python/current/bin/python
# -*- coding: iso-8859-1 -*-
import sys
import os
from progadn import *
ab1seq = raw_input
14 matches
Mail list logo