thanks a lot!
:)
--
http://mail.python.org/mailman/listinfo/python-list
which one has best performance?
a:for i in range(0,len(a))
b:for x in a
c:for x,y in enumerate(a)
but, it seems I cann't get index number with b format..:(
--
http://mail.python.org/mailman/listinfo/python-list
>>> a='String'
>>> for x in a:
... print x
...
S
t
r
i
n
g
>>>
can I get the index number of a in the upon loop within for x in a
loop?
--
http://mail.python.org/mailman/listinfo/python-list
>>> 10/3.0
3.3335
>>> int(10/3.0)
3
--
http://mail.python.org/mailman/listinfo/python-list
thanks!
I try the "try" before, but can't catch the socket error. so strange,
maybe my code was error.
I wrote a retry code block as below.
import httplib,time
while 1:
try:
conn = httplib.HTTPConnection("www.test.com")
conn.request("GET", "/")
print "success"
Hi :
I want to get many html page on same server.
I have tried httplib and urllib.
I think httplib is better one because it's httplib.HTTPConnection. It
will establish one network connection then do other opration before
connection close. The urllib will establish network connection each
time re
I wrote a script to get 100 pages from a server.
like below:
1:import httplib
2:conns = httplib.HTTPConnection("www.mytest.com")
3:conn.request("GET", "/")
sometimes a socket error was raised.
File "D:\usr\bin\lib\httplib.py", line 627, in connect
raise socket.error, msg
socket.error: (100
sorry, would you please give a sample code?
I want to use HTTPConnection to get a html page content via a http
proxy.
thanks.
--
http://mail.python.org/mailman/listinfo/python-list
how to use httplib.HTTPConnection with http proxy?
--
http://mail.python.org/mailman/listinfo/python-list
how to use httplib.HTTPConnection with http proxy?
--
http://mail.python.org/mailman/listinfo/python-list
in fact, I want to do a script to get news on others site.
I must use script get the content and analyze the html code, where is
the title, where is the body
so, I can't ask permission, use wget and "Physically remove the
harddrive and reinstall it locally"
:)
--
http://mail.python.org/mailm
...
I will do it later. but i want to optimize the script first.
after useing muti-thread, the time speed up from 8s to 2.3s per page.
any other suggestions?
--
http://mail.python.org/mailman/listinfo/python-list
Hi
I want to get 20 html pages content from one server, you know
urllib.urlopen need construct network connection, it will be very
slowly, how to speed up this function?
I try to using multi-thread, it speed up, but I want to quickly more,
any idea about it?
Thanks!
--
http://mail.python.o
how about
$ python test.py 2> /dev/null
?
--
http://mail.python.org/mailman/listinfo/python-list
cool!
thanks !
--
http://mail.python.org/mailman/listinfo/python-list
I want to get a html page content via a http proxy.
befor this, I want to check the proxy. how to validate it?
thanks
--
http://mail.python.org/mailman/listinfo/python-list
If a proxy is alive then return true, else return fals after 1 second.
thanks
--
http://mail.python.org/mailman/listinfo/python-list
thank you! I am not good at it.
--
http://mail.python.org/mailman/listinfo/python-list
who can help me?
please give me a sample code. thanks a lot.
--
http://mail.python.org/mailman/listinfo/python-list
19 matches
Mail list logo