This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#读取本地E:\python_pro\本地脚本\sample.html文件,并将其中的表格数据提取出来 | |
import pandas as pd | |
from bs4 import BeautifulSoup | |
import json | |
# 定义一个结构体类 | |
class Struct: | |
def __init__(self, link, target, imgPath, before_p, after_p): | |
self.link = link | |
self.target = target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#python | |
import json,urllib | |
from urllib.parse import urlencode | |
import urllib.request | |
url = 'http://api.k780.com/' | |
params = { | |
'app' : 'finance.rate', | |
'scur' : 'USD', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var name = "The Window"; | |
var object = { | |
name : "My Object", | |
getNameFunc : function(){ | |
return function(){ | |
return this.name; | |
}; | |
} | |
}; | |
alert(object.getNameFunc()()); //out put The window |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import urllib2 | |
def auto_check(): | |
opener = urllib2.build_opener() | |
opener.addheaders = [ | |
('User-Agent', 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36') | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
import os | |
import sys | |
# 将系统的编码设置为UTF8 | |
reload(sys) | |
sys.setdefaultencoding('utf8') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from struct import * | |
ofile=open('sz000680.day','rb') | |
buf=ofile.read() | |
ofile.close() | |
ifile=open('sz000680.txt','w') | |
num=len(buf) | |
no=num/32 | |
b=0 | |
e=32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
''' | |
File: xiami.py | |
Author: Luigi Fan | |
Description: Auto check-in script for xiami. | |
''' | |
import requests | |
import re |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
date('H'); | |
date('Y-m-d H:i:s'); | |
$endTime_h = date('H'); | |
$endTime_m = date('i'); | |
echo $endTime_m;echo "<br/>"; | |
if($endTime_m > 30){ | |
$work_m = 0.5; | |
}else{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a1 = Point(1, 5) | |
b1 = Point(4, 5) | |
c1 = Point(1, 2) | |
d1 = Point(4, 2) | |
r = Rectangle(a1, b1, c1, d1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Point: | |
def __init__(self, x=0, y=0): | |
self.x = x | |
self.y = y | |
a = Point(1, 4) | |
b = Point(4, 4) | |
c = Point(1, 2) | |
d = Point(4, 2) |
NewerOlder