Re: Direct interaction with subprocess - the curse of blocking I/O

2009-06-30 Thread cgoldberg
> So well, I'd like to know, do you people know any solution to this > simple problem - making a user interact directly with a subprocess? you might want something like Expect. check out the pexpect module: http://pexpect.sourceforge.net/pexpect.html -Corey -- http://mail.python.org/mailman/li

Re: handling https sites

2009-06-26 Thread cgoldberg
> Is there any module in python to open https > sites through a proxy. yes, you can use "urllib2". from the urllib2 docs: "The default is to read the list of proxies from the environment variables" So if you have a proxy setup, it should detect it from your environment vars. If you want to spec

Re: Graphical library - charts

2009-06-22 Thread cgoldberg
> I suggest you look at matplotlib. +1 Another vote Matplotlib. It has impressive graphing/plotting capabilities and is used as a Python module/library. Description from site: "matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats

Re: urllib2 slow for multiple requests

2009-05-14 Thread cgoldberg
> It might be, if the local server doesn't scale well enough to handle > 100 concurrent requests. true.. I didn't think of that. I was assuming the client machine wasn't resource constrained. That would definitely lead to inaccurate timings if that was the case. -- http://mail.python.org/ma

Re: urllib2 slow for multiple requests

2009-05-14 Thread cgoldberg
> The problem is, that CentOS is running on the server and there is only > 2.4 available. On wich version did you ran these tests? I tested with Windows XP and Python 2.5.4. I don't have a 2.4 setup I can easily test with. you can try httplib rather than urllib2. httplib is slightly lower level

Re: urllib2 slow for multiple requests

2009-05-13 Thread cgoldberg
> Bascally it just grabs a page xy > times and tells me how long it took. you aren't doing a read(), so technically you are just connecting to the web server and sending the request but never reading the content back from the socket. So your timing wouldn't be accurate. try this instead: respons

Re: free chart lib for Python?

2009-05-08 Thread cgoldberg
> You could try matplotlib:http://matplotlib.sourceforge.net. +1 Matplotlib. It's a very nice module with impressive graphing/charting/plotting capabilities. -- http://mail.python.org/mailman/listinfo/python-list

Re: Scraping a web page

2009-04-07 Thread cgoldberg
> Is there anyway I > can get almost a screen capture of the page? I'm not sure exactly what you mean by "screen capture". But the webbrowser module in the standard lib might be of some help. You can use it to drive a web browser from Python. to load a page in your browser, you can do something

Re: debuglevel for a HTTP request

2009-03-24 Thread cgoldberg
> It doesn't show the debug output, any ideas? I think like this: opener = urllib2.build_opener(urllib2.HTTPHandler(debuglevel=1)) -- http://mail.python.org/mailman/listinfo/python-list

Re: Guidance on writing a top-like console

2009-03-16 Thread cgoldberg
> >> I am interested in writing an application that functions like a Unix > >> or Linux top in the way it displays data. > >> It should be command-line based but dynamically refreshing. also check out the source for "dstat". It is written in python and displays top-like information and more. It

Re: PyWin32 for Python 3.x

2009-03-16 Thread cgoldberg
> Release 213 is out already: Tim, Mark, this is great news.. thanks for tracking 3.x so closely. I big barrier for me to eventually adopt 3.x is the ability to use pywin32. thanks! -Corey -- http://mail.python.org/mailman/listinfo/python-list

Re: parallel/concurrent process in python

2009-03-10 Thread cgoldberg
> Why not use os.fork(), it is the same as C's fork? os.fork is not cross platform. It is *nix only. Subprocess runs on Windows also. The OP never specified his platform. -Corey -- http://mail.python.org/mailman/listinfo/python-list

Re: Themed TK (tk Tile) at last?!

2009-03-07 Thread cgoldberg
> This is a big deal in that while tkinter came with (just about) every > Python the desire to use wxWidgets or Qt etc was high because tkinter > widgets just look so horrid. I liked Tk a lot, but also moved to wx because of Tk's L&F. Tk is great for simple tool interfaces. Great news. -Corey -

Re: getting all HTTP headers from urllib2 Request?

2009-03-03 Thread cgoldberg
> > Looking at the httplib sources, the only headers it may add are Host,   > > Accept-Encoding: identity, and Content-Length. now that I think of it, if it is only 3 headers, I can just override them explicitly from urllib2 and then log that. thanks a lot for looking into the httplib source! -

Re: getting all HTTP headers from urllib2 Request?

2009-03-03 Thread cgoldberg
> Looking at the httplib sources, the only headers it may add are Host,   > Accept-Encoding: identity, and Content-Length. those are exactly the headers I want to capture. do you know how to get a hold of them from a request using urllib2. -Corey -- http://mail.python.org/mailman/listinfo/pyth

Re: getting all HTTP headers from urllib2 Request?

2009-03-03 Thread cgoldberg
> I didn't try it, but the Request Class from urllib2 has a method > called, header_items(). That could be what your looking for. yes, that method only shows you all the headers added by urllib2. there are other headers that are produced by httplib under the covers that are added to the outgoing

getting all HTTP headers from urllib2 Request?

2009-03-02 Thread cgoldberg
I have a Python web client that uses urllib2. It is easy enough to add my own HTTP headers to the outgoing requests. I just create a dictionary of the headers I want to add, and pass it to the Request initializer. These custom headers are not all that gets sent. urllib2 attaches headers also. Y