Re: how to change sys.path?

2006-05-24 Thread Ju Hui
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

how to change sys.path?

2006-05-23 Thread Ju Hui
is python search module by paths in sys.path? how to change it manuallly? -- http://mail.python.org/mailman/listinfo/python-list

Re: how to change sys.path?

2006-05-23 Thread Ju Hui
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

Re: how to change sys.path?

2006-05-23 Thread Ju Hui
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

Re: Getting URL's

2006-05-19 Thread Ju Hui
use htmlparser or regular expression -- http://mail.python.org/mailman/listinfo/python-list

Re: how to remove 50000 elements from a 100000 list?

2006-05-06 Thread Ju Hui
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

how to remove 50000 elements from a 100000 list?

2006-05-05 Thread Ju Hui
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:

Re: how to remove 50000 elements from a 100000 list?

2006-05-05 Thread Ju Hui
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

Re: how to use socks5 proxy in pycurl?

2006-04-20 Thread Ju Hui
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

how to use socks5 proxy in pycurl?

2006-04-18 Thread Ju Hui
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')

Re: how to use socks5 proxy in pycurl?

2006-04-18 Thread Ju Hui
No one use this function? -- http://mail.python.org/mailman/listinfo/python-list

Re: I wanna use urllib2 to get a page with a socks 5 proxy, who can give me a sample code ?

2006-04-12 Thread Ju Hui
thanks a lot! -- http://mail.python.org/mailman/listinfo/python-list

how to install PYCURL 7.15.2 on windows 2003?

2006-04-12 Thread Ju Hui
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.2setup.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, in

how to print without blank?

2006-04-09 Thread Ju Hui
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

Re: how to print without blank?

2006-04-09 Thread Ju Hui
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 ?

2006-04-09 Thread Ju Hui
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. --

Re: I wanna use urllib2 to get a page with a socks 5 proxy, who can give me a sample code ?

2006-04-09 Thread Ju Hui
thanks, I will try pycurl. -- http://mail.python.org/mailman/listinfo/python-list

how to use urllib2 to get a page with a socks 5 proxy?

2006-04-07 Thread Ju Hui
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

is there any bug in this multi-thread script?

2006-04-05 Thread Ju Hui
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

Re: is there any bug in this multi-thread script?

2006-04-05 Thread Ju Hui
up... -- http://mail.python.org/mailman/listinfo/python-list

Re: Installing Python 2.4 on RedHat

2006-04-05 Thread Ju Hui
install new version on differente location. use ln -s to use new python. -- http://mail.python.org/mailman/listinfo/python-list