import pycurl
c = pycurl.Curl()
c.setopt( pycurl.URL, 'http://www.test.com/test.html' )
import StringIO
b = StringIO.StringIO()
c.setopt( c.WRITEFUNCTION, b.write )
c.setopt( c.FOLLOWLOCATION, 1 )
c.setopt( c.MAXREDIRS, 5 )
c.setopt(c.PROXY,'www.test.com:1080')
#c.setopt(c.PROXYTYPE,'SOCKS5')
c.set
No one use this function?
--
http://mail.python.org/mailman/listinfo/python-list
sorry, I can'y find sample python code there.
I don't know how to set PROXYTYPE..
:(
--
http://mail.python.org/mailman/listinfo/python-list
I want to remove about 5 elements from a list,which has 10
elements.
sample code like below:
>>> a=range(10)
>>> b=range(4)
>>> for x in b:
... a.remove(x)
...
>>> a
[4, 5, 6, 7, 8, 9]
when a and b is small size, it will finished quickly, but when a and b
have many elements.
such as:
cool!
thanks you all!
I choose
a=set(range(10))
b=set(range(5))
a.symmetric_difference(b)
certainly,the real data not range(), I am satisfied the performance of
set.difference
thank you all again!
--
http://mail.python.org/mailman/listinfo/python-list
to Andrew Gwozdziewycz:
Real humor...
Peter Otten:
thanks your reminder, in my project, a will a superset of b.
so symmetric_difference equals difference.
thank you all again!
--
http://mail.python.org/mailman/listinfo/python-list
use
htmlparser or regular expression
--
http://mail.python.org/mailman/listinfo/python-list
is python search module by paths in sys.path?
how to change it manuallly?
--
http://mail.python.org/mailman/listinfo/python-list
yes, I mean I want change the sys.path value and save it for next
using.
I can change the value of sys.path, but I can't "save" it permanently.
There is no python_path environment on my pc, what the relationship
between it and the sys.path?
--
http://mail.python.org/mailman/listinfo/python-list
yes, we can change PYTHONPATH to add some path to sys.path value, but
how to remove item from sys.path?
--
http://mail.python.org/mailman/listinfo/python-list
yes, we can add path to PYTHONPATH,but how to remove some items?
my sys.path:
>>> import sys
>>> for x in sys.path:
... print x
...
D:\usr\local\lib\site-packages\setuptools-0.6a11-py2.4.egg
D:\usr\local\lib\site-packages\clientcookie-1.3.0-py2.4.egg
c:\temp
C:\WINDOWS\system32\python24.zip
C:
I wrote a script to do work with multi-thread in a queue reference
others code.
Is there any bug in this script?
another question is : when we call start to run one thread extends from
threading, it will call a join() by itself? I want to monitor the
qsize() to ensure all work are finished. but whe
up...
--
http://mail.python.org/mailman/listinfo/python-list
install new version on differente location.
use ln -s to use new python.
--
http://mail.python.org/mailman/listinfo/python-list
example,
the proxy server is :123.123.123.123
and the port is :1080
and the username/password is : user/pass
I want to open http://www.google.com
how to write this script?
thanks.
--
http://mail.python.org/mailman/listinfo/python-list
I want to print 3 numbers without blank.
>>> for x in range(3):
... print x
...
0
1
2
>>> for x in range(3):
... print x,
...
0 1 2
how to print
012
?
thanks.
--
http://mail.python.org/mailman/listinfo/python-list
thank you all. IT's very helpful to me.
>>> import sys
>>> def no_space_before(x):
... sys.stdout.softspace = 0
... return x
...
>>> for x in range(3):
... print no_space_before(x),
...
012
--
http://mail.python.org/mailman/listinfo/python-list
I wanna use urllib2 to get a page with a socks 5 proxy,who can give me
a sample code ?
example,
the proxy server is :123.123.123.123
and the port is :1080
and the username/password is : user/pass
I want to open http://www.google.com
how to write this kind of script?
thanks.
--
http://mail.pyt
thanks, I will try pycurl.
--
http://mail.python.org/mailman/listinfo/python-list
thanks a lot!
--
http://mail.python.org/mailman/listinfo/python-list
I download it from http://pycurl.sourceforge.net/
and then extract it to D:\usr\pycurl-7.15.2
then
D:\usr\pycurl-7.15.2>setup.py install --curl-dir=d:\usr\pycurl-7.15.2
Using curl directory: d:\usr\pycurl-7.15.2
Traceback (most recent call last):
File "D:\usr\pycurl-7.15.2\setup.py", line 197, i
21 matches
Mail list logo