code
stringlengths
1
1.72M
language
stringclasses
1 value
""" Giovanni's MicroCompiler Demo <program> ::= { <id> ; <vars > <stmtlist> } <vars> ::= V { <id> ; } % DECLARATIONS <stmtlist> ::= <stmt> { ; <stmt> } <stmt> ::= P <id> | <id> = <expr> <expr> ::= <factor> { (+ | -)...
Python
""" Giovanni's MicroCompiler Demo <program> ::= { <id> ; <vars > <stmtlist> } <vars> ::= V { <id> ; } % DECLARATIONS <stmtlist> ::= <stmt> { ; <stmt> } <stmt> ::= P <id> | <id> = <expr> <expr> ::= <factor> { (+ | -)...
Python
""" Giovanni's MicroCompiler Demo <program> ::= { <id> ; <vars > <stmtlist> } <vars> ::= V { <id> ; } % DECLARATIONS <stmtlist> ::= <stmt> { ; <stmt> } <stmt> ::= P <id> | <id> = <expr> <expr> ::= <factor> { (+ | -)...
Python
""" Giovanni's MicroCompiler Demo <program> ::= { <id> ; <vars > <stmtlist> } <vars> ::= V { <id> ; } % DECLARATIONS <stmtlist> ::= <stmt> { ; <stmt> } <stmt> ::= P <id> | <id> = <expr> <expr> ::= <factor> { (+ | -)...
Python
""" Giovanni's MicroCompiler Demo <program> ::= { <id> ; <vars > <stmtlist> } <vars> ::= V { <id> ; } % DECLARATIONS <stmtlist> ::= <stmt> { ; <stmt> } <stmt> ::= P <id> | <id> = <expr> <expr> ::= <factor> { (+ | -)...
Python
""" Giovanni's MicroCompiler Demo <program> ::= { <id> ; <vars > <stmtlist> } <vars> ::= V { <id> ; } % DECLARATIONS <stmtlist> ::= <stmt> { ; <stmt> } <stmt> ::= P <id> | <id> = <expr> <expr> ::= <factor> { (+ | -)...
Python
''' Created on Jun 23, 2014 @author: Brian ''' """ Giovanni's MicroCompiler Demo <program> ::= { <id> ; <vars > <stmtlist> } <vars> ::= V { <id> ; } % DECLARATIONS <stmtlist> ::= <stmt> { ; <stmt> } <stmt> ::= P <id> | <id> = <expr>...
Python
''' Created on Jun 23, 2014 @author: Brian ''' """ Giovanni's MicroCompiler Demo <program> ::= { <id> ; <vars > <stmtlist> } <vars> ::= V { <id> ; } % DECLARATIONS <stmtlist> ::= <stmt> { ; <stmt> } <stmt> ::= P <id> | <id> = <expr>...
Python
''' Created on Jun 23, 2014 @author: Brian ''' """ Giovanni's MicroCompiler Demo <program> ::= { <id> ; <vars > <stmtlist> } <vars> ::= V { <id> ; } % DECLARATIONS <stmtlist> ::= <stmt> { ; <stmt> } <stmt> ::= P <id> | <id> = <expr>...
Python
''' Created on Jun 23, 2014 @author: Brian ''' """ Giovanni's MicroCompiler Demo <program> ::= { <id> ; <vars > <stmtlist> } <vars> ::= V { <id> ; } % DECLARATIONS <stmtlist> ::= <stmt> { ; <stmt> } <stmt> ::= P <id> | <id> = <expr>...
Python
''' Created on Jun 23, 2014 @author: Brian ''' """ Giovanni's MicroCompiler Demo <program> ::= { <id> ; <vars > <stmtlist> } <vars> ::= V { <id> ; } % DECLARATIONS <stmtlist> ::= <stmt> { ; <stmt> } <stmt> ::= P <id> | <id> = <expr>...
Python
import re __author__ = 'YeeHin Kwok' """ Giovanni's MicroCompiler Demo <program> ::= { <id> ; <varDeclare > <stmtlist> } <varDeclare> ::= V { <id> ; } % DECLARATIONS <stmtlist> ::= <stmt> { ; <stmt> } <stmt> ::= P <id> | <id> = <exp...
Python
import math def sieve_of_atkin(limit): results = [2, 3, 5] sieve = [False]*(limit+1) factor = int(math.sqrt(limit))+1 for i in range(1, factor): for j in range(1, factor): n = 4*i**2+j**2 if (n <= limit) and (n % 12 == 1 or n % 12 == 5): sieve...
Python
import struct import Atkin import random from array import array class MyException (Exception): pass #m = 11*19 # large primes should be used #xi = 0 ''' def eratosthenes(n): multiples = [] primes1 = [] for i in range(2, n+1): if i not in multiples: primes1.append...
Python
import math """" int CACHE = 30000; // размер кэша int M = (int)Math.sqrt(N)+1; int primes = new int[P]; // массив простых чисел до корня из N boolean segment = new boolean[CACHE]; // вторичное решето for (int I=M-1; I < N; I+=CACHE) { Arrays.fill(segment, true); for (int i= 0; i < P; i++) {...
Python
#==================================================================== # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you ...
Python
#!/usr/bin/python2.6 # # Simple http server to emulate api.playfoursquare.com import logging import shutil import sys import urlparse import SimpleHTTPServer import BaseHTTPServer class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): """Handle playfoursquare.com requests, for testing.""" def do_GET(self...
Python
#!/usr/bin/python import os import subprocess import sys BASEDIR = '../main/src/com/joelapenna/foursquare' TYPESDIR = '../captures/types/v1' captures = sys.argv[1:] if not captures: captures = os.listdir(TYPESDIR) for f in captures: basename = f.split('.')[0] javaname = ''.join([c.capitalize() for c in basena...
Python
#!/usr/bin/python """ Pull a oAuth protected page from foursquare. Expects ~/.oget to contain (one on each line): CONSUMER_KEY CONSUMER_KEY_SECRET USERNAME PASSWORD Don't forget to chmod 600 the file! """ import httplib import os import re import sys import urllib import urllib2 import urlparse import user from xml....
Python
#!/usr/bin/python import datetime import sys import textwrap import common from xml.dom import pulldom PARSER = """\ /** * Copyright 2009 Joe LaPenna */ package com.joelapenna.foursquare.parsers; import com.joelapenna.foursquare.Foursquare; import com.joelapenna.foursquare.error.FoursquareError; import com.joel...
Python
#!/usr/bin/python import logging from xml.dom import minidom from xml.dom import pulldom BOOLEAN = "boolean" STRING = "String" GROUP = "Group" # Interfaces that all FoursquareTypes implement. DEFAULT_INTERFACES = ['FoursquareType'] # Interfaces that specific FoursqureTypes implement. INTERFACES = { } DEFAULT_CLA...
Python
#!/usr/bin/python import cgi import cgitb cgitb.enable() import os print "Content-Type: text/html\n" print "<html>" print "<head><title>Quad 20 in CGI" print "</title></head>" print "<body>" for e in range(1,21): print str(e*e)+'</br>' print "</body></html>"
Python
#!/usr/bin/python print "Content-Type: text/html\n" import os, random, cgi, cgitb cgitb.enable() i = 0 c=0 richtig = 0 erg = 0 a= random.randint(1,11) b= random.randint(1,11) form = cgi.FieldStorage() if "i" in form: i = int(form["i"].value) if "erg" in form: erg = int(form["erg"].value) if "c" in form: c = int(form["...
Python
#!/usr/bin/python print "Content-Type: text/html\n" import os l = os.environ["HTTP_ACCEPT_LANGUAGE"].split(";") if "en" in l[0]: print "Hello World" else: print "Hallo Welt"
Python
#!/usr/bin/python print "Content-Type: text/html\n" import os, random, cgi, cgitb cgitb.enable() i = 0 c=0 richtig = 0 erg = 0 a= random.randint(1,11) b= random.randint(1,11) form = cgi.FieldStorage() if "i" in form: i = int(form["i"].value) if "erg" in form: erg = int(form["erg"].value) if "c" in form: c = int(form["...
Python
#!/usr/bin/python print "Content-Type: text/html\n" import cgi import cgitb cgitb.enable() import os form = cgi.FieldStorage() n = 20 if "n" in form: n = form["n"].value print "<html>" print "<head><title>n Quadratzahlen" print "</title></head>" print "<body>" for e in range(1,int(n)+1): print str(e*e)+'</br>' pri...
Python
#!/usr/bin/python print "Content-Type: text/html\n" import os, sys, random directory = "/usr/share/games/fortunes/" l = os.listdir(directory) b = [] for e in l: if ".u8" not in e and ".dat" not in e and "de" not in e: b.append(e) s = "" for e in b: f = open(directory+e) s+=f.read() f.close() ...
Python
#!/usr/bin/python print "Content-Type: text/html\n" print "<html>" print "<head><title>Hallo CGI-Python" print "</title></head>" print "<body>" print "Hello CGI Python" print "</body></html>"
Python
#!/usr/bin/python import cgi import cgitb cgitb.enable() import os print "Content-Type: text/html\n" print "<html>" print "<head><title>Quad 20 in CGI" print "</title></head>" print "<body>" for e in range(1,21): print str(e*e)+'</br>' print "</body></html>"
Python
#!/usr/bin/python print "Content-Type: text/html\n" print "Hallo CGI-Welt"
Python
#!/usr/bin/python print "Content-Type: text/html\n" import os l = os.environ["HTTP_ACCEPT_LANGUAGE"].split(";") if "en" in l[0]: print "Hello World" else: print "Hallo Welt"
Python
#!/usr/bin/python print "Content-Type: text/html\n" import os for key in os.environ: print key, "=" print os.environ[key], "<br />" if os.environ.has_key("QUERY_STRING"): print os.environ["QUERY_STRING"]
Python
#!/usr/bin/python print "Content-Type: text/html\n" import os for key in os.environ: print key, "=" print os.environ[key], "<br />" if os.environ.has_key("QUERY_STRING"): print os.environ["QUERY_STRING"]
Python
#!/usr/bin/python print "Content-Type: text/html\n" print "<html>" print "<head><title>Hallo CGI-Python" print "</title></head>" print "<body>" print "Hello CGI Python" print "</body></html>"
Python
#!/usr/bin/python print "Content-Type: text/html\n" import cgi import cgitb cgitb.enable() import os form = cgi.FieldStorage() n = 20 if "n" in form: n = form["n"].value print "<html>" print "<head><title>n Quadratzahlen" print "</title></head>" print "<body>" for e in range(1,int(n)+1): print str(e*e)+'</br>' pri...
Python
#!/usr/bin/python print "Content-Type: text/html\n" print "Hallo CGI-Welt"
Python
#!/usr/bin/python print "Content-Type: text/html\n" import os, sys, random directory = "/usr/share/games/fortunes/" l = os.listdir(directory) b = [] for e in l: if ".u8" not in e and ".dat" not in e and "de" not in e: b.append(e) s = "" for e in b: f = open(directory+e) s+=f.read() f.close() ...
Python
#!/usr/bin/python import cgi import cgitb cgitb.enable() print "Content-Type: text/html\n" print "<html>" print "<body>" for a in range(1,21): print str(a**2)+'<br/>' print "</body>" print "</html>"
Python
#!/usr/bin/python import cgi import cgitb import random cgitb.enable() form = cgi.FieldStorage() x = random.randint(1, 10) y = random.randint(1, 10) z = 0 erg = 0 right = 0 if form.has_key("Zaehler"): z = z + int(form["Zaehler"].value) z=z+1 if z < 4 : erg = x + y o = '+' else : erg = x * y o...
Python
#!/usr/bin/python import os print "Content-Type: text/html\n" for key in os.environ: print key, "=" print os.environ[key], "<br />"
Python
#!/usr/bin/python import os import cgi import cgitb cgitb.enable() print "Content-Type: text/html\n" print "<html>" print "<head><title>Hallo Tim</title></head>" print "<body>" if os.environ["HTTP_ACCEPT_LANGUAGE"][:2]=='en': print "Hello World!" else: print "Hallo Welt!" print "</body>" pri...
Python
#!/usr/bin/python import cgi import cgitb cgitb.enable() print "Content-Type: text/html\n" print "<html>" print "<body>" form = cgi.FieldStorage() if form.has_key("n"): n = form.getvalue("n") for a in range(1,int(n)+1): print str(a**2)+'<br/>' else: n = 21 for a in range(1,n): ...
Python
#!/usr/bin/python import cgi import cgitb import fortune cgitb.enable() print "Content-Type: text/html\n" print "<html>" print "<body>" print "<head><title>Fortune</title></head>" form = cgi.FieldStorage() if form.has_key("m"): #m = form["m"].value //alternative m = form.getvalue("m") print fortune.ge...
Python
#!/usr/bin/python import cgi import cgitb import random cgitb.enable() form = cgi.FieldStorage() x = random.randint(1, 10) y = random.randint(1, 10) z = 0 erg = 0 right = 0 if form.has_key("Zaehler"): z = z + int(form["Zaehler"].value) z=z+1 if z < 4 : erg = x + y o = '+' else : erg = x * y o...
Python
#!/usr/bin/python import cgi import cgitb cgitb.enable() print "Content-Type: text/html\n" print "<html>" print "<body>" for a in range(1,21): print str(a**2)+'<br/>' print "</body>" print "</html>"
Python
#!/usr/bin/python import cgi import cgitb cgitb.enable() print "Content-Type: text/html\n" print "<html>" print "<head><title>Hallo Tim</title></head>" print "<body>" print "Hallo Welt!" print "</body>" print "</html>"
Python
#!/usr/bin/python #-*-coding: utf-8-*- import os import sys import random import string def getRandomQuote(): files=os.listdir("/usr/share/games/fortune") files=[f for f in files if ".dat" not in f and ".u8" not in f] f=random.sample(files, 1) s=file("/usr/share/games/fortune/"+f[0]).read() quotes...
Python
#!/usr/bin/python import os import cgi import cgitb cgitb.enable() print "Content-Type: text/html\n" print "<html>" print "<head><title>Hallo Tim</title></head>" print "<body>" if os.environ["HTTP_ACCEPT_LANGUAGE"][:2]=='en': print "Hello World!" else: print "Hallo Welt!" print "</body>" pri...
Python
#!/usr/bin/python import os print "Content-Type: text/html\n" for key in os.environ: print key, "=" print os.environ[key], "<br />"
Python
#!/usr/bin/python #-*-coding: utf-8-*- import os import sys import random import string def getRandomQuote(): files=os.listdir("/usr/share/games/fortune") files=[f for f in files if ".dat" not in f and ".u8" not in f] f=random.sample(files, 1) s=file("/usr/share/games/fortune/"+f[0]).read() quotes...
Python
#!/usr/bin/python import cgi import cgitb cgitb.enable() print "Content-Type: text/html\n" print "<html>" print "<body>" form = cgi.FieldStorage() if form.has_key("n"): n = form.getvalue("n") for a in range(1,int(n)+1): print str(a**2)+'<br/>' else: n = 21 for a in range(1,n): ...
Python
#!/usr/bin/python import cgi import cgitb cgitb.enable() print "Content-Type: text/html\n" print "<html>" print "<head><title>Hallo Tim</title></head>" print "<body>" print "Hallo Welt!" print "</body>" print "</html>"
Python
#!/usr/bin/python import cgi import cgitb import fortune cgitb.enable() print "Content-Type: text/html\n" print "<html>" print "<body>" print "<head><title>Fortune</title></head>" form = cgi.FieldStorage() if form.has_key("m"): #m = form["m"].value //alternative m = form.getvalue("m") print fortune.ge...
Python
#!/usr/bin/python import cgi import cgitb cgitb.enable() print "Content-Type: text/html\n" print "<html>" print "<head>" print "<title> ptreb quad cgi </title>" print "</head>" print "<body>" print [x**2 for x in range(1,21)] print "</body>" print "</html>"
Python
#!/usr/bin/python print "Content-Type: text/html\n" import cgi import cgitb cgitb.enable() import os template = "<html><head><title>%s</title></head><body>%s</body></html>" title = "Mein Titel" content = "<h2>Hallo international</h2>" dic = {"de":"hallo welt", "en":"hello World"} mylan = "de" lan = os.environ["HTTP_...
Python
#!/usr/bin/python #-*- coding: utf-8 -*- # print erzeugt einen zeilunumbruch automatisch print "Content-Type: text/html\n" # wichtig cgi module importieren # import ohne .py wenn im selben ordner # fortune.methode zum benutzen einer funktion import fortune import cgi import cgitb cgitb.enable() #main, war in fortun...
Python
#!/usr/bin/python print "Content-Type: text/html\n" print "<html>" print "<head>" print "<title> ptreb hallo cgi </title>" print "</head>" print "<body>" print "Hello CGI Python " print "</body>" print "</html>"
Python
#!/usr/bin/python #-*- coding: utf-8 -*- print "Content-Type: text/html\n" import cgi import cgitb cgitb.enable() import random form = cgi.FieldStorage() #zustaende auslesen # variablen initialisieren # aus fieldStorage komme nur strings => immer casten title = "CGI Rechner" runde = int(form["runde"].value) +1 if ...
Python
#!/usr/bin/python print "Content-Type: text/html\n" import cgi import cgitb import os cgitb.enable() print "<html>" print "<head>" print "<title> ptreb quadn cgi </title>" print "</head>" print "<body>" form = cgi.FieldStorage() # inhalt query string n = 20 if "n" in form: n = int(form["n"].value) print [z**2 f...
Python
#!/usr/bin/python #-*- coding: utf-8 -*- # alles in einem nicht modul ausgelagert print "Content-Type: text/html\n" # wichtig cgi module importieren import cgi import cgitb cgitb.enable() import os import random import string import sys def getString(source): """Gibt einen grossen String zurueck und erwartet ei...
Python
#!/usr/bin/python import cgi import cgitb cgitb.enable() print "Content-Type: text/html\n" print "<html>" print "<head>" print "<title> ptreb quad cgi </title>" print "</head>" print "<body>" print [x**2 for x in range(1,21)] print "</body>" print "</html>"
Python
#!/usr/bin/python #-*- coding: utf-8 -*- # modul das nur die logik funktionen enthaelt, webanwendung und darstellung in # cgi script import os import random import string import sys def getString(source): """Gibt einen grossen String zurueck und erwartet eine Liste von Dateinamen. """ collection = ''...
Python
#!/usr/bin/python print "Content-Type: text/html\n" import cgi import cgitb cgitb.enable() import os template = "<html><head><title>%s</title></head><body>%s</body></html>" title = "Mein Titel" content = "<h2>Hallo international</h2>" dic = {"de":"hallo welt", "en":"hello World"} mylan = "de" lan = os.environ["HTTP_...
Python
#!/usr/bin/python #-*- coding: utf-8 -*- # modul das nur die logik funktionen enthaelt, webanwendung und darstellung in # cgi script import os import random import string import sys def getString(source): """Gibt einen grossen String zurueck und erwartet eine Liste von Dateinamen. """ collection = ''...
Python
#!/usr/bin/python print "Content-Type: text/html\n" import cgi import cgitb import os cgitb.enable() print "<html>" print "<head>" print "<title> ptreb quadn cgi </title>" print "</head>" print "<body>" form = cgi.FieldStorage() # inhalt query string n = 20 if "n" in form: n = int(form["n"].value) print [z**2 f...
Python
#!/usr/bin/python #-*- coding: utf-8 -*- # alles in einem nicht modul ausgelagert print "Content-Type: text/html\n" # wichtig cgi module importieren import cgi import cgitb cgitb.enable() import os import random import string import sys def getString(source): """Gibt einen grossen String zurueck und erwartet ei...
Python
#!/usr/bin/python #-*- coding: utf-8 -*- print "Content-Type: text/html\n" import cgi import cgitb cgitb.enable() import random form = cgi.FieldStorage() #zustaende auslesen # variablen initialisieren # aus fieldStorage komme nur strings => immer casten title = "CGI Rechner" runde = int(form["runde"].value) +1 if ...
Python
#!/usr/bin/python print "Content-Type: text/html\n" print "<html>" print "<head>" print "<title> ptreb hallo cgi </title>" print "</head>" print "<body>" print "Hello CGI Python " print "</body>" print "</html>"
Python
#!/usr/bin/python #-*- coding: utf-8 -*- # print erzeugt einen zeilunumbruch automatisch print "Content-Type: text/html\n" # wichtig cgi module importieren # import ohne .py wenn im selben ordner # fortune.methode zum benutzen einer funktion import fortune import cgi import cgitb cgitb.enable() #main, war in fortun...
Python
#!python """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() If you want to require a specific version of setuptools...
Python
#! /usr/bin/env python # -*- coding: utf-8 -*- # setup.py # Part of 21obuys, a package providing enumerated types for Python. # # Copyright © 2007 Ben Finney # This is free software; you may copy, modify and/or distribute this work # under the terms of the GNU General Public License, version 2 or later # or, at your ...
Python
""" 1. Generate ie6 module with win32/com/tools/readtlb.py from the ctypes package (I forget the details, but you can probably skip this and just use ie6_gen.py that comes with ctypes in the samples directory -- change the 'import ie6' below as appropriate.) 2. Generate a GUID and cut-n-paste it as Pyth...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-7-26 京东价格图片识别模块 @author: zhongfeng ''' import ImageFilter, ImageChops from captcha_price import * from j360buy.j360_feature import J360buy_FEATURES_MAP__ import Image import re import time try: import psyco psyco.full() except ImportError: ...
Python
#/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-7-29 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from j360buy.image_price import captcha_360buy from pageparser import * from threadpool import ThreadPool, WorkRequest import json import os import re import string import threading ...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-16 @author: zhongfeng ''' J360buy_FEATURES_MAP__ = { ''' __ __ __ __ __ ...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-7-26 京东价格图片识别模块 @author: zhongfeng ''' import ImageFilter, ImageChops from captcha_price import * from j360buy.j360_feature import J360buy_FEATURES_MAP__ import Image import re import time try: import psyco psyco.full() except ImportError: ...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-1 @author: zhongfeng ''' from j360buy.j360pageparser import parserDict,j360buyRoot from spider import main if __name__ == '__main__': main(j360buyRoot,parserDict)
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-16 @author: zhongfeng ''' J360buy_FEATURES_MAP__ = { ''' __ __ __ __ __ ...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- from logfacade import LoggerFactory ''' Created on 2011-10-9 @author: zhongfeng ''' from crawlerhttp import crawle import re from threadpool import ThreadPool, WorkRequest from dbproc.basedbproc import getConnect,MySQLQueryPagination def getProdImgUrlFro...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- from logfacade import LoggerFactory ''' Created on 2011-10-9 @author: zhongfeng ''' from crawlerhttp import crawle import re from threadpool import ThreadPool, WorkRequest from dbproc.basedbproc import getConnect,MySQLQueryPagination def getProdImgUrlFro...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-1 @author: zhongfeng ''' from j360buy.j360pageparser import parserDict,j360buyRoot from spider import main if __name__ == '__main__': main(j360buyRoot,parserDict)
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-9-24 @author: zhongfeng ''' import re,os,sys import chardet from pageparser import ObuyUrlSummary from utils import Singleton from ConfigParser import ConfigParser, NoOptionError def __getUrlSumsFromSection(section): curPath = os....
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-7-26 图片识别模块 @author: zhongfeng ''' import ImageFilter, ImageChops import Image import re,itertools import time try: import psyco psyco.full() except ImportError: pass class CaptchaAlgorithm(object): '''captcha algorithm''' def Le...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-7-26 京东价格图片识别模块 @author: zhongfeng ''' import ImageFilter, ImageChops from captcha_price import * from medicine.kxr.kxr_feature import KXR_FEATURES_MAP__ import Image import os,sys try: import psyco psyco.full() except ImportError: pass ...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2012-02-29 @author: zhongfeng ''' KXR_FEATURES_MAP__ = { ''' ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ __##__ __##__ ______ '...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-7-26 京东价格图片识别模块 @author: zhongfeng ''' import ImageFilter, ImageChops from captcha_price import * from medicine.kxr.kxr_feature import KXR_FEATURES_MAP__ import Image import os,sys try: import psyco psyco.full() except ImportError: pass ...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2012-02-29 @author: zhongfeng ''' KXR_FEATURES_MAP__ = { ''' ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ __##__ __##__ ______ '...
Python
#/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2006-02-11 抓取核心类,用于抓取页面; 可以支持登陆抓取等; @author: zhongfeng ''' from __future__ import with_statement import urllib import urllib2 import socket import gzip import zlib import cookielib from copy import deepcopy from threadpool import Threa...
Python
#/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-10-18 @author: zhongfeng ''' from crawlerhttp import crawle from logfacade import LoggerFactory from urlparse import urlparse import os,sys import time from multiprocessing import Pool,Queue logger = LoggerFactory.getLogger() def ...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-8-27 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from pageparser import * from spiderconfigparser import SpiderConfig from crawlerhttp import crawleRetries icsonRoot = ObuyUrlSummary(url=r'http://www.icson.com/portal.html', name='i...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-25 @author: zhongfeng ''' from icson.icsonpageparser import parserDict,icsonRoot from spider import ObuySpider from crawlerhttp import CrawlResult import os,sys from logfacade import LoggerFactory from upload import fileUpload from s...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-8-27 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from pageparser import * from spiderconfigparser import SpiderConfig from crawlerhttp import crawleRetries icsonRoot = ObuyUrlSummary(url=r'http://www.icson.com/portal.html', name='i...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-25 @author: zhongfeng ''' from icson.icsonpageparser import parserDict,icsonRoot from spider import ObuySpider from crawlerhttp import CrawlResult import os,sys from logfacade import LoggerFactory from upload import fileUpload from s...
Python
#/usr/bin/env python # -*- coding: utf-8 -*- import re import time import random from BeautifulSoup import BeautifulSoup from crawlerhttp import UrlSummary, crawle urlsProxy = ["http://proxy.ipcn.org/proxylist.html"] #urlsProxy = ["http://www.proxycn.com/html_proxy/http-1.html"] desSite = 'http://www.360...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-16 @author: zhongfeng ''' SUNING_FEATURES_MAP = { ''' __ __ __ __ __ __ __ __ __ __ __ ## ## ''' : '.', ...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-7-26 国美价格图片识别模块 @author: zhongfeng ''' import ImageFilter, ImageChops from captcha_price import * from suning.suning_feature import SUNING_FEATURES_MAP import Image import itertools import re import time try: import psyco psyco.full() except ...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-7-26 国美价格图片识别模块 @author: zhongfeng ''' import ImageFilter, ImageChops from captcha_price import * from suning.suning_feature import SUNING_FEATURES_MAP import Image import itertools import re import time try: import psyco psyco.full() except ...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-16 @author: zhongfeng ''' SUNING_FEATURES_MAP = { ''' __ __ __ __ __ __ __ __ __ __ __ ## ## ''' : '.', ...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-2 @author: zhongfeng ''' from suning.suningparser import parserDict,sunningRoot from spider import main if __name__ == '__main__': main(sunningRoot,parserDict)
Python
#/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-8-25 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from pageparser import * from spiderconfigparser import SpiderConfig from threadpool import ThreadPool from suning.image_price import captcha_suning sunningRoot = ObuyUrlSummary(url=...
Python