Skip to content

Instantly share code, notes, and snippets.

@newbiethetest
newbiethetest / tes.py
Created July 30, 2013 00:42
in line 48 it print the website title ,bug i want to print the title and the website name,someone can give me some idea?
import Queue
import threading
import urllib2
import time
from BeautifulSoup import BeautifulSoup
hosts = ["http://yahoo.com", "http://google.com", "http://amazon.com",
"http://ibm.com", "http://apple.com"]
queue = Queue.Queue()
#-*- coding: utf-8 -*-
__author__ = 'newbie@kali'
import re
import sys,getopt
import Queue
import threading
import urllib2
import time
class GetResult:
def __init__(self):
self.result=[] #here i have changed
def add(self,x,y):
z= x+y
self.result.append(z)
rs=GetResult()
rs.add(1,2) #the result is [3]
print rs.result
from django.db import models
# Create your models here.
class MY_ROLE(models.Model):
role_name = models.CharField(max_length=20)
def __unicode__(self):
return self.role_name
class MY_USER(models.Model):
import pycurl
import StringIO
import re
def initCurl():
c=pycurl.Curl()
#c.setopt(pycurl.COOKIEFILE,"cookie_file_name")
#c.setopt(pycurl.COOKIEJAR,"cookie_file_name")
c.setopt(pycurl.FOLLOWLOCATION,0)
c.setopt(pycurl.CONNECTTIMEOUT, 1) #
c.setopt(pycurl.MAXREDIRS,1)
# -*- coding:utf8 -*-
__author__ = 'newbie0086#foxmail.com'
import Queue
import threading
from ftplib import FTP
import os,sys,string,datetime,time
import socket
class MyFtp:
def __init__(self,host,username,password,port=21):
self.host=host
# -*- coding:utf8 -*-
import urllib
import curl
import pycurl
import StringIO
def initCurl():
c=pycurl.Curl()
c.setopt(pycurl.FOLLOWLOCATION,0)
queue = Queue.Queue()
out_queue = Queue.Queue()
class ThreadUrl(threading.Thread):
"""Threaded Url Grab"""
def __init__(self, queue, out_queue):
threading.Thread.__init__(self)
self.queue = queue
self.out_queue = out_queue
assume cs:code,ds:data,ss:stack
stack segment
dw 0,0,0,0,0,0,0,0
stack ends
data segment
db '1. display '
db '2. brows '
db '3. replace '
数据库某表TABLE_1内容如下:
LINE_A LINE_B
a 1
a 2
b
b 3
c
c