how to call back a method in python3?

2014-08-03 Thread
I want to call back a function which is the method of a class . def callback(self.do,x): return(self.do(x)) That is what i want to write,when i input def callback(self.do,x): error message: File "", line 1 def callback(self.do,x): ^

NameError: name 'requests' is not defined ?

2014-07-27 Thread
there is a simple file `mydown.py` saved in `D:\Python34\Lib\site-packages` there is only one line in mydown.py . import requests C:\Users\pengsir>d:\Python34\python Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:25:23) [MSC v.1600 64 bit (AM D64)] on win32 Type "help", "copy

回复: problem on multi-threading

2014-07-25 Thread
-- 原始邮件 -- 发件人: "Sturla Molden";; 发送时间: 2014年7月26日(星期六) 凌晨4:04 收件人: "python-list"; 主题: Re: problem on multi-threading "水静流深" <1248283...@qq.com> wrote: > name=['60', '01', '600319', '6

problem on multi-threading

2014-07-25 Thread
The right program is as following,everything is ok. import requests import threading import queue class webdata(object): def __init__(self,name): self.jobs=queue.Queue() for x in name: url='http://stockhtm.finance.qq.com/sstock/ggcx/%s.shtml' %x se

回复: how to download special range content with requests in python?

2014-07-23 Thread
? it is target to practice the threading and queue module . ‍ -- 原始邮件 -- 发件人: "Chris Angelico";; 发送时间: 2014年7月23日(星期三) 晚上11:58 收件人: 抄送: "python-list"; 主题: Re: how to download special range content with requests in python? On Wed, Jul 23,

how to download special range content with requests in python?

2014-07-23 Thread
url='http://debian.cites.illinois.edu/pub/debian-cd/7.6.0/amd64/iso-cd/debian-7.6.0-amd64-CD-1.iso' import requests r = requests.get(url).read(0,1000) ‍ why i can not download special range(from 0 to 1) content with requests in python‍?-- https://mail.python.org/mailman/listinfo/python-

Not enough memory.

2014-07-14 Thread
>>> import os >>> help(os.path) Not enough memory.‍ Why i get it?Not enough memory , not help info?,not-- https://mail.python.org/mailman/listinfo/python-list

how can i get the source code of goagent.exe?

2014-07-02 Thread
There is a open source project-goagent,when you download it and extract it, code.google.com/p/goagent/downloads‍ in the local diretory, a file named goagent.exe in it. how can i get the source code of goagent.exe ,not the binary form ,the text form.-- https://mail.python.org/mailman/listinfo/p

回复: why i can't install ez_setup

2014-06-28 Thread
No urls, filenames, or requirements specified (see --help)‍ How can i install it now? -- 原始邮件 -- 发件人: "Mark Lawrence";; 发送时间: 2014年6月29日(星期天) 凌晨1:24 收件人: "python-list"; 主题: Re: why i can't install ez_setup On 28/06/2014 16:36, Chris “Kwp

why i can't install ez_setup

2014-06-28 Thread
I have downloaoded ez_setup.py ,when i install it ,the wrong message: >python d:\ez_setup.py Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-5.2. zip Exception calling "DownloadFile" with "2" argument(s): "Unable to connect to th e remote server" At line:1 char:152 + [

回复: write 中文 into c:\t1

2012-01-29 Thread
file.write(s.decode('gbk').encode('utf-8')) i open the file c:\t1, to get 中文 in it not 涓枃 -- 原始邮件 -- 发件人: "MRAB"; 发送时间: 2012年1月27日(星期五) 上午10:53 收件人: "python-list"; 主题: Re: write 中文 into c:\t1 On 27/01/2012 02:46, contro opinion wrote: > |>>> s='\xd6\xd0

how to install lxml in window xp?

2012-01-09 Thread
in my xp ,python26,easy_install installed. i want to install lxml in window xp 1.c:\python26\scripts\easy_install lxml what i get is: Reading http://codespeak.net/lxml Best match: lxml 2.3.3 Downloading http://lxml.de/files/lxml-2.3.3.tgz Processing lxml-2.3.3.tgz Running lxml-2.3.3\setup.p

回复: problem to install Flask

2012-01-05 Thread
yes i run python3,how to install flask in python3? -- 原始邮件 -- 发件人: "MRAB"; 发送时间: 2012年1月6日(星期五) 中午11:05 收件人: "python-list"; 主题: Re: problem to install Flask On 06/01/2012 02:24, 水静流深 wrote: > ~$ sudo easy_install Flask > Sea

problem to install Flask

2012-01-05 Thread
~$ sudo easy_install Flask Searching for Flask Reading http://pypi.python.org/simple/Flask/ Reading http://github.com/mitsuhiko/flask/ Best match: Flask 0.8 Downloading http://pypi.python.org/packages/source/F/Flask/Flask-0.8.tar.gz#md5=a5169306cfe49b3b369086f2a63816ab Processing Flask-0.8.tar.gz

回复: install lxml

2011-10-23 Thread
-- 原始邮件 -- 发件人: "Terry Reedy"; 发送时间: 2011年10月24日(星期一) 中午12:58 收件人: "python-list"; 抄送: "lxml"; 主题: Re: install lxml On 10/24/2011 12:02 AM, 水静流深 wrote: > there are two python versions in my computer, > python2.7 is the

回复: getroot() problem

2011-10-23 Thread
rnal entity "http://frux.wikispaces.com/";' 2. ubuntu11.04+python2.6 import lxml.html sfile='http://frux.wikispaces.com/' root=lxml.html.parse(sfile).getroot() it is ok it is so strange thing for me to understand -- 原始邮件 -- 发件人: "Dave A

install lxml

2011-10-23 Thread
there are two python versions in my computer, python2.7 is the default,python3.2 is the second install. for python2.7 ~$python Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24) [GCC 4.5.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import lxml >>

getroot() problem

2011-10-23 Thread
C:\Documents and Settings\peng>cd c:\python32 C:\Python32>python Python 3.2.2 (default, Sep 4 2011, 09:51:08) [MSC v.1500 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information. >>> import lxml.html >>> sfile='http://finance.yahoo.com/q/op?s

回复: python32 to write file

2011-10-23 Thread
on c:\xml.py Traceback (most recent call last): File "c:\xml.py", line 5, in root=lxml.html.fromstring(root) File "C:\Python32\lib\site-packages\lxml\html\__init__.py", line 630, in froms tring if start.startswith('; 发送时间: 2011年10月23日(星期天) 晚上9:48 收件人: "水

python32 to write file

2011-10-23 Thread
code 1 can run in python2.6 #coding:utf-8 import urllib import lxml.html down='http://frux.wikispaces.com/' root=urllib.urlopen(down).read() root=lxml.html.fromstring(root) file=root.xpath('//a') for i in file: str1=i.text_content() if str1.find('pdf') >-1 : str2='http://frux.wi