script in Linux vs Windows

A

aurfalien

Hi all,

Unsure how to deal with what appears to be \n vs \r issues.

The following code works in Linux;

o = open("axenfs.reg")
n = open("axenfs2.reg", "a")
while 1:
line = o.readline()
if not line: break
line = line.replace("dword:00000","dword:0000044e")
n.write(line)
n.close()

But in Windows, its one continues line with a bunch of squares in it.

So I add + '\r\n' to my second to last line so it looks like;

n.write(line + '\r\n')

But I still get one continuous line with squares in it.

Any ideas? I've been googing all day to no avail.

Desperately seeking advice.

- aurf
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,169
Messages
2,570,919
Members
47,460
Latest member
eibafima

Latest Threads

Top