2016年12月30日 星期五

2016年12月29日 星期四

send gmail

step 1:please read the policy of gmail http://stackoverflow.com/questions/20337040/gmail-smtp-debug-error-please-log-in-via-your-web-browser step 2: ex: http://stackoverflow.com/questions/17332384/python-3-send-email-smtp-gmail-error-smtpexception ex: no chinese in code http://johnisacoolboy.pixnet.net/blog/post/148222978-python-email%E5%AF%84%E4%BF%A1%E6%A8%A1%E7%B5%84%E7%9A%84%E4%BD%BF%E7%94%A8%E6%96%B9%E5%BC%8F

2016年12月25日 星期日

OID Pen

principle: http://thps0612.blogspot.tw/2015/06/blog-post_23.html https://www.youtube.com/watch?v=A6yKZ1wjUgg https://www.youtube.com/watch?v=JViaNBbwpfQ https://www.youtube.com/watch?v=4AjvjFM8GzM

2016年11月30日 星期三

2016年11月25日 星期五

[Label] hover effort by using event

def callback_text(event):
    txt_keyword = event.widget.cget("text")
    idx_start = txt_keyword.find("https")
    idx_end = len(txt_keyword) - 1
    url = txt_keyword[idx_start : idx_end]
    webbrowser.open_new(url)
    event.widget.config(text = "X |" + txt_keyword)


def changeBGLeave(event):
    event.widget.config(fg="red")

def changeBGEnter(event):
    event.widget.config(fg="blue")




            lbl = Label(root,  text = txt_content , fg="blue", cursor="hand2")          
            lbl.pack(anchor="w")
            lbl.bind("<Button-1>", callback_text)
            lbl.bind("<Enter>",changeBGLeave)
            lbl.bind("<Leave>",changeBGEnter)


http://stackoverflow.com/questions/4299145/getting-the-widget-that-triggered-an-event

2016年11月21日 星期一

2016年11月20日 星期日

2016年11月19日 星期六

2016年11月18日 星期五

[Crawler] Beginning: Trying urllib.request

method 1: open a File and save it in your current python Folder.
method 2:

type each command

import urllib.request

x = urllib.request.urlopen("http://www.google.com/")

print(x.read())

https://www.youtube.com/watch?v=5GzVNi0oTxQ


2.type line by line as below code
from urllib.request import urlopen
html = urlopen("http://www.google.com/")
print(html)
print(html.read())



http://stackoverflow.com/questions/22676/how-do-i-download-a-file-over-http-using-python

reference:
[book] A Brain-Friendly Guide, Paul Barry && David Griffths

2016年11月17日 星期四

2016年11月16日 星期三

2016年11月12日 星期六

test

/* $.getJSON("https://spreadsheets.google.com/feeds/cells/1IuQajNlsOX0w2NXRqPurqvWggEtWnygjToZLMqUFGNc/1/public/values?alt=json", function(data) { //first row "title" column // console.log(data.feed.entry[0]['gsx$title']['$t']); alert("qq"); alert(data.feed.entry[0]['gsx$title']['$t']); }); $.getJSON("https://spreadsheets.google.com/feeds/cells/1IuQajNlsOX0w2NXRqPurqvWggEtWnygjToZLMqUFGNc/1/public/values?alt=json", function(result){ $.each(result, function(i, field){ $("div").append(field + " "); }); }); //https://docs.google.com/spreadsheets/d/1IuQajNlsOX0w2NXRqPurqvWggEtWnygjToZLMqUFGNc/pubhtml $.getJSON("https://spreadsheets.google.com/feeds/cells/1IuQajNlsOX0w2NXRqPurqvWggEtWnygjToZLMqUFGNc/1/public/values?alt=json",function(JData){ for (var i=0; i < JData.feed.entry.length ;i++){ var id = JData.feed.entry[i].id.$t; //link??? var title = JData.feed.entry[i].title.$t; //A1 var content = JData.feed.entry[i].content.$t; //content if(i !== 0 && i % 2 == 0) { $( ".inner" ).append("
"); } if(i % 2 == 0) { $( ".inner" ).append("cell_" + i + "(image tag) = " + content + "; "); } else { $( ".inner" ).append("cell_" + i + "(image description) = " + content + "; "); } } }); */

reference:
https://docs.google.com/spreadsheets/d/1IuQajNlsOX0w2NXRqPurqvWggEtWnygjToZLMqUFGNc/edit?usp=sharing
http://www.ioa.tw/google-sheets-api-note.html
http://www.kamira.co.vu/2012/11/jquery-google-spreadsheet.html
http://www.w3schools.com/jquery/ajax_getjson.asp
http://stackoverflow.com/questions/24293329/getting-json-data-from-google-spreadsheets-uncaught-typeerror
http://jsonviewer.stack.hu/#https://spreadsheets.google.com/feeds/cells/1IuQajNlsOX0w2NXRqPurqvWggEtWnygjToZLMqUFGNc/1/public/values?alt=json

JQuery
http://api.jquery.com/append/

https://forum.gamer.com.tw/Co.php?bsn=60292&sn=7871
http://stackoverflow.com/questions/14885231/getting-value-of-a-cell-from-google-docs-spreadsheet-into-javascript