On Jul 30, 10:43 pm, Lie <[EMAIL PROTECTED]> wrote:
> Lessons learned, should test codes even if you thought it seemed
> trivial.
And I learned I should always make sure to cut&paste the right
example :)
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 27, 10:02 am, alex23 <[EMAIL PROTECTED]> wrote:
> Ugh, and in pointing our your inaccurate code I posted my own:
>
> > >>> f = open('dummy.txt','w')
> > >>> f.write(line = 'this doesn't work')
>
> > File "", line 1
> > f.write(line = 'this doesn't work')
> >
On Jul 26, 10:02 pm, alex23 <[EMAIL PROTECTED]> wrote:
> Ugh, and in pointing our your inaccurate code I posted my own:
>
> > >>> f = open('dummy.txt','w')
> > >>> f.write(line = 'this doesn't work')
>
> > File "", line 1
> > f.write(line = 'this doesn't work')
> >
Ugh, and in pointing our your inaccurate code I posted my own:
> >>> f = open('dummy.txt','w')
> >>> f.write(line = 'this doesn't work')
>
> File "", line 1
> f.write(line = 'this doesn't work')
>^
> SyntaxError: invalid syntax
That should be:
>>> f.write(li
On Jul 27, 9:26 am, Lie Ryan <[EMAIL PROTECTED]> wrote:
> Btw, if you do f.write('line = line[:22] + "A" + line[23:]'), you'd
> output exactly that, and not inserting the 23rd character, you'd want to
> do this instead: f.write(line = line[:22] + "A" + line[23:])
Please check your examples before
On Sat, 2008-07-26 at 17:47 +0200, Francesco Pietra wrote:
> Sorry to come again for the same problem. On commanding:
>
> $ python script.py 2>&1 | tee fileout.pdb
>
> nothing occurred (fileout.pdb was zero byte). The script reads:
>
> f = open("xxx.pdb", "w")
> f.write('line = line[:22] + "A" +
Sorry to come again for the same problem. On commanding:
$ python script.py 2>&1 | tee fileout.pdb
nothing occurred (fileout.pdb was zero byte). The script reads:
f = open("xxx.pdb", "w")
f.write('line = line[:22] + "A" + line[23:]')
f.close()
File xxx.pdb is opened by the command: when I forgo
Francesco Pietra wrote:
How to insert letter "A" on each line (of a very long list of lines)
at position 22, i.e., one space after "LEU", leaving all other
characters at the same position as in the original example:
ATOM 1 N LEU 1 146.615 40.494 103.776 1.00 73.04 1SG
On Jul 26, 5:42 pm, "Francesco Pietra" <[EMAIL PROTECTED]> wrote:
> I am still at the stone age, using scripts (e.g., to insert a string
> after a string) of the type
>
> f = open("xxx.pdb", "r")
> for line in f:
> print line
> if "H16Z POPC" in line:
> print "TER"
> f.close()
>
> That
I am still at the stone age, using scripts (e.g., to insert a string
after a string) of the type
f = open("xxx.pdb", "r")
for line in f:
print line
if "H16Z POPC" in line:
print "TER"
f.close()
That is, I have to learn about modules. In your scripts I am lost
about the filename for t
On Jul 26, 2:41 pm, "Francesco Pietra" <[EMAIL PROTECTED]> wrote:
> How to insert letter "A" on each line (of a very long list of lines)
> at position 22, i.e., one space after "LEU", leaving all other
> characters at the same position as in the original example:
>
> ATOM 1 N LEU 1
Francesco Pietra wrote:
> How to insert letter "A" on each line (of a very long list of lines)
> at position 22, i.e., one space after "LEU", leaving all other
> characters at the same position as in the original example:
>
>
> ATOM 1 N LEU 1 146.615 40.494 103.776 1.00 73.04
12 matches
Mail list logo