超級網迷

超級網迷+ 電腦迷+ 音樂迷
個人資料
正文

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!

[ 打印 ]
閱讀 ()評論 (1)
評論
目前還沒有任何評論
登錄後才可評論.