Re: appending file
- From: Bruno Desthuilliers <bdesth.quelquechose@xxxxxxxxxxxxxxxxxxx>
- Date: Sat, 30 Jun 2007 06:36:34 +0200
Kuo a écrit :
Hi,
I'm trying to read a file (fileA) and append to another file(fileB). However, I always get "^M" at the end. Does anyone know why ? Here is my code ?
os.system("../syn/pin_assign.pl customer_netlist.txt")
shutil.copy("../fileB", "fileB")
ucf = open("fileB", "a")
pin = open("fileA", "r")
ucf.write(pin.read())
ucf.close;
pin.close;
sys.exit(0);
Here is what I get.
# FPGA CLOCK^M
NET "SYSCLK_A" loc = N16 | TNM_NET = SYSCLK_A;^M
NET "SYSCLK_AN" loc = M16 | TNM_NET = SYSCLK_A;^M
Looks like a problem with newline format. Googling for "universal newline" may be a good start.
.
- References:
- appending file
- From: Kuo
- appending file
- Prev by Date: Re: PEP 3107 and stronger typing (note: probably a newbie question)
- Next by Date: Re: ORM layer
- Previous by thread: Re: appending file
- Next by thread: ORM layer
- Index(es):
Relevant Pages
|