Skip to content

Instantly share code, notes, and snippets.

@hiworlds
hiworlds / readwrite.py
Last active December 15, 2015 01:59
Python: 读写文件方法一
#--------------readwrite.py-----------------#
#--------------read and write file----------#
#write(string)
f = open("readwrite.txt",'w')
f.write("Welcome to this file\nThere is nothing here except\nThis stupid haiku\n")
f.close()
#writelines(list)
f = open("readwrite.txt")#默认为读
lines = f.readlines()
@hiworlds
hiworlds / browseFolder.js
Created March 18, 2013 00:10
JavaScript: 弹出路径选择框
/**
* browseFolder.js
* 该文件定义了BrowseFolder()函数,它将提供一个文件夹选择对话框
* 以供用户实现对系统文件夹选择的功能
* 文件夹选择对话框起始目录由
* Shell.BrowseForFolder(WINDOW_HANDLE, Message, OPTIONS, strPath)函数
* 的strPath参数设置
* 例如:0x11--我的电脑
* 0 --桌面
* "c:\\"--系统C盘