2010年2月18日 星期四

python打開網址原始碼寫入文字檔

python打開網址原始碼寫入文字檔如下,
\\\\\\\\\\\\\\\\\\\\\
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#python 3.1
#python為unicode編碼
#decode解碼
#encode編碼

import urllib.request

url1="http://www.pchome.com.tw"
f = urllib.request.urlopen(url1)
ff=f.read().decode("utf-8")
f.close()
strff=str(ff)

j=open("./sample.txt","w")
j.writelines(strff)
j.close()



\\\\\\\\\\\\\\\\\\
沒有加上decode就會出現x90\xbd\xe6\的結果

2010年2月16日 星期二

usb隨身碟開機+(grub4dos)


###########這種方法太麻煩可不用,2012/08/19更新#############
主要使用HP的hpusbfw.exe
http://h50178.www5.hp.com/local_drivers/17019/SP27213.exe
(HP官網載點,安裝完畢後在 C:\DriveKey\)

file system 要選fat32才可制作dos開機usb隨身碟

這裏的p:\ 為軟碟機具有開機功能的軟碟

因為剛好我的軟碟壞了要找虛擬軟碟機

Virtual floppy driver(虛擬軟碟機)
按下Install 、Start開始虛擬
-->
Driver0Change此為選擇軟碟機代號,此處選了p:\
之後按open。選擇98se開機制成的開機映象檔如:98se.imz

然後執行第一步、usb隨身碟就可開機了~
###########這種方法太麻煩可不用,2012/08/19更新#############
一、連接usb隨身碟
二、格式化隨身碟為fat32
三、http://download.gna.org/grub4dos/
下載grub4dos的grubinst-1.1-bin-w32-2008-01-01.zip
四、 下載grub4dos-0.4.4-2009-06-20.zip。
複製 grldr 與 menu.lst 從 grub4dos.zip (或是從HBCD folder) 到  usb隨身碟


五、編輯menu.lst
title Windows XP/2000/2003 Setup
map --unmap=0:0xff
map --unhook
savedefault
find --set-root --ignore-cd /usbdrive.tag
configfile /winsetup.lst

title Install Ubuntu 9.10
root (hd0,0)
kernel (hd0,0)/ubuntu/vmlinuz boot=casper iso-scan/filename=/ubuntu/ubuntu-9.10-desktop-i386.iso
initrd (hd0,0)/ubuntu/initrd.lz

title Start Hiren's BootCD
find --set-root /HBCD/boot.gz
kernel /HBCD/memdisk
initrd /HBCD/boot.gz

#######更新20140312################
最容易方式適用
http://rufus.akeo.ie/




2010年2月6日 星期六

camstudio(免費螢幕錄影軟體)

http://camstudio.org/
Camstudio是一款opensource的錄影軟體。
紅字按扭錄影(熱鍵F8),藍色按扭停止(熱鍵F9)。