strange problems with code generation
Eric_Dexter at msn.com
Eric_Dexter at msn.com
Fri Dec 1 20:24:18 EST 2006
I am writing out zero byte files with this (using python 2.5). I have
no idea why I am having that problem, I am also looking for an example
of readlines where I can choose a number of lines say lines 12 to 14
and then write them back to disk. any help would be apreaceted.
import sys as sys2
import os as os2
def playscoreinrange(from_file, fromline, toline):
"untested way to play a series of lines from a orc, sco combination
line 14 may not be correct"
print(from_file)
fromfile = os2.path.basename(from_file)
print(fromfile)
orcfilename = fromfile[:-4] + '.orc'
print(orcfilename)
infile2 = open(orcfilename, 'r')
outfile2 = open('temp.orc', 'w')
for line in infile2:
outfile2.write(line)
infile = open(fromfile, 'r')
outfile = open('temp.sco','w')
data = sys2.stdin.readlines()
print(data)
for linenumber in range(fromline, toline):
outfile.writeline(data[linenumber])
https://sourceforge.net/projects/dex-tracker
http://www.dexrow.com
os2.startfile('temp.bat')
More information about the Python-list
mailing list