Draw lines set
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
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())
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
reference:
[book] A Brain-Friendly Guide, Paul Barry && David Griffths
2016年11月17日 星期四
Autoplay and loop audio in blogger
It is impossible to autoplay on android chrome because google's policy.
But I let the song loop from a list.
Source Code:
But I let the song loop from a list.
Source Code:
2016年11月16日 星期三
GitHub
1. https://gist.github.com/
Adding your code to blogger using GitHub Gist
https://sofree.cc/github-gist/
Adding your code to blogger using GitHub Gist
https://sofree.cc/github-gist/
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
"); } 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