Python 1-2-3: Write a string to file

超级网迷+ 电脑迷+ 音乐迷
打印 被阅读次数

[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!

登录后才可评论.