Hello: I have a problem about how to generate a specific.txt file. I use the following code:
#!/usr/bin/python # OS: Ubuntu import subprocess fileName = open ('final.txt', 'a') fileName.write ('%s %s %s \n' % (12,25,9)) desLrr = subprocess.Popen('echo "hello" >> final.txt ', shell=True) fileName.seek(0,2) fileName.write ('%s %s %s \n' % (85,25,12)) fileName.close() The above code generates the following result: 12 25 9 85 25 12 hello What I want is: 12 25 9 hello 85 25 12 Could someone provies some suggestions about this problem? Thank you.
-- http://mail.python.org/mailman/listinfo/python-list