Python 1-2-3: Write a string to file
文章來源: 在城裏2011-03-03 19:45:33

[Tip]:  Add the python install directory to the Path environment:
        i.e: set PATH=%PATH%;C:/Python27

[Script]:
       
# Write string (utf-8) to a file named "writestring.py"
# Date: Mar-3-2011

file = "n:/8/utorrent.exe"
f = open(file, 'r+')
words = 'this is my string'
f.seek(50)
f.write(words)
f.close()

# End of script
# Compiled and tested on vista Home x64


Programming is fun
When the work is done
if you wanna make your work also fun:
use Python!