Should proxy objects lie about their class name?

2007-11-20 Thread John J. Lee
Not much to add to the subject line. I mean something like this: ProxyClass.__name__ = ProxiedClass.__name__ I've been told that this is common practice. Is it? Would this surprise you if you ran into it in a debugging session? One very real advantage that I can see is avoiding breaking exis

Re: trace module and doctest

2007-11-22 Thread John J. Lee
[EMAIL PROTECTED] writes: > I am trying to use the trace module with the --count flag to test for > statement coverage in my doctests. The trace coverage listing is very > weird, marking many statements as unexecuted which were clearly executed > during the run (I can see their output on the scre

Re: Python too complex ?!?!?!

2007-11-22 Thread John J. Lee
"Chris Mellon" <[EMAIL PROTECTED]> writes: > On Nov 20, 2007 2:43 PM, John J. Lee <[EMAIL PROTECTED]> wrote: >> "Chris Mellon" <[EMAIL PROTECTED]> writes: >> [...] >> > These modules exist, but aren't that common. Certainly anythi

Re: Clean way to get one's network IP address?

2007-11-22 Thread John J. Lee
Gilles Ganault <[EMAIL PROTECTED]> writes: > I need to get the local computer's IP address, ie. what's displayed > when running "ifconfig" in Linux: > > # ifconfig > eth0 Link encap:Ethernet HWaddr 00:15:58:A1:D5:6F > inet addr:192.168.0.79 Bcast:192.168.0.255 > Mask:255.255.255

Re: Should proxy objects lie about their class name?

2007-11-26 Thread John J. Lee
[EMAIL PROTECTED] (John J. Lee) writes: > Not much to add to the subject line. I mean something like this: > > ProxyClass.__name__ = ProxiedClass.__name__ > > > I've been told that this is common practice. Is it? Would this > surprise you if you ran into it in a debug

Re: Should proxy objects lie about their class name?

2007-11-27 Thread John J. Lee
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > John J. Lee schrieb: >> [EMAIL PROTECTED] (John J. Lee) writes: >> >>> Not much to add to the subject line. I mean something like this: >>> >>> ProxyClass.__name__ = ProxiedClass.__name

Re: issue with cookielib.LWPCookieJar

2007-12-03 Thread John J. Lee
JD Smith <[EMAIL PROTECTED]> writes: > Greetings: > > My cookiejar contains the cookie that I need however when I do > cj.save(file) it does not actually save out to the cookies.lwj Does > anyone have any clue what would keep this from saving? It CREATED my > cookies.lwj file so I know it's not

Re: Minimalistic Software Transactional Memory

2007-12-09 Thread John J. Lee
Michael Sparks <[EMAIL PROTECTED]> writes: > Duncan Booth wrote: > >> Michael Sparks <[EMAIL PROTECTED]> wrote: >> >>> I'm interested in writing a simple, minimalistic, non persistent (at >>> this stage) software transactional memory (STM) module. The idea being >>> it should be possible to write

Re: send cookie on request with urllib2

2006-04-20 Thread John J. Lee
"itay_k" <[EMAIL PROTECTED]> writes: > Hi, > > I dont understand why this is so complicated, just to add one line of > cookie header on the GET request. You haven't said what you're really trying to do. http://www.catb.org/~esr/faqs/smart-questions.html#goal > This is my unworking code: > imp

Re: http request with cookie sending

2006-04-20 Thread John J. Lee
Kent Johnson <[EMAIL PROTECTED]> writes: > itay_k wrote: > > Hi, > > > > I want to send a cookie on some http request (with urllib2), > > so I created a Cookie but I cant associate it with CookieJar object. > > You have to use a cookielib.Cookie, not Cookie.SimpleCookie(): As I mention in the o

Re: urllib2.ProxyHandler

2006-04-20 Thread John J. Lee
"rx" <[EMAIL PROTECTED]> writes: > I'm trying to hide my IP with the following code: > > import urllib2 > proxy=[urllib2.ProxyHandler({'http':'24.232.167.22:80'})] > opener=urllib2.build_opener(proxy) build_opener takes *args, not a list: import urllib2 handlers = [urllib2.ProxyHandler({'http':'

Re: how to use socks5 proxy in pycurl?

2006-04-20 Thread John J. Lee
"Ju Hui" <[EMAIL PROTECTED]> writes: [...] > how to use socks5 proxy in pycurl? http://curl.haxx.se/mail/list.cgi?list=curl-and-python John -- http://mail.python.org/mailman/listinfo/python-list

Re: send cookie on request with urllib2

2006-04-20 Thread John J. Lee
Kent Johnson <[EMAIL PROTECTED]> writes: > itay_k wrote: > > Hi, > > > > I dont understand why this is so complicated, just to add one line of > > cookie header on the GET request. > > > > This is my unworking code: > > import time > > import Cookie > > import cookielib, urllib2 > > > > c= cook

Re: how to use socks5 proxy in pycurl?

2006-04-21 Thread John J. Lee
"Ju Hui" <[EMAIL PROTECTED]> writes: > sorry, I can'y find sample python code there. > I don't know how to set PROXYTYPE.. > > :( Note quite sure which post you're replying to since you don't quote any of it, but if replying to me: URL I posted was for a mailing list specifically devoted to pyth

Re: send cookie on request with urllib2

2006-04-21 Thread John J. Lee
"itay_k" <[EMAIL PROTECTED]> writes: > ok. > i will explain what exactly i wanna do. > > i want to simulate the following client-side script with python: > > > > > document.cookie="name=tom"; > document.images["Pic"].src="temp2.html" > Ah! In which case what you're trying t

Re: repr() for Perl?

2006-04-22 Thread John J. Lee
[EMAIL PROTECTED] writes: > Sorry to ask a Perl question here, but... Does Perl have something like > Python's repr() function? I want to print out a string and have CR print as > \r, LF as \n, etc. I looked in the Perl/Python phrasebook: > > http://wiki.python.org/moin/PerlPhrasebook > >

Re: how to browse using urllib2 and cookeilib the correct way

2006-04-26 Thread John J. Lee
[EMAIL PROTECTED] writes: [...] > 1) >>>import urllib2,urllib,cookielib > 2) >>>cj = cookielib.CookieJar() > 3) >>>opener = urllib2.build_opener( urllib2.HTTPCookieProcessor(cj)) > 4) >>>data = urllib.urlencode ( { "username" : "user" , >"password" :"" } ) > 5) >>>fp = opener.open( > "h

Re: how to browse using urllib2 and cookeilib the correct way

2006-04-26 Thread John J. Lee
Edward Elliott <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: > > can anybody explain, in the first case why i need to do two attempts. > > I would guess it's because redhat requires your browser to submit a session > cookie with the login form. In the urllib2 example, the first request

Re: self modifying code

2006-04-29 Thread John J. Lee
Robin Becker <[EMAIL PROTECTED]> writes: > When young I was warned repeatedly by more knowledgeable folk that self > modifying code was dangerous. > > Is the following idiom dangerous or unpythonic? > > def func(a): > global func, data > data = somethingcomplexandcostly() > def f

Re: Using a browser as a GUI: which Python package

2006-04-29 Thread John J. Lee
"André" <[EMAIL PROTECTED]> writes: [...] > I would like to use a browser (e.g. Firefox) as a simple GUI > "framework". Note that this is to be done on a single user machine, so > the question of sandboxing is not really relevant here. [...] > My ultimate goal would be to port the main features of

Re: Urllib2 / add_password method

2006-04-29 Thread John J. Lee
"mrstephengross" <[EMAIL PROTECTED]> writes: > I'm working on learning how to use urllib2 to use a proxy server. I've > looked through the postings on this group, and it's been helpful. I > have not, however, found complete documentation on the add_password() > functions. Here's what I've got so f

Re: [wwwsearch-general] Re: Urllib2 / add_password method

2006-04-29 Thread John J Lee
On Sat, 29 Apr 2006, John J. Lee wrote: > "mrstephengross" <[EMAIL PROTECTED]> writes: > >> I'm working on learning how to use urllib2 to use a proxy server. I've >> looked through the postings on this group, and it's been helpful. I >>

Re: urllib.urlopen() with pages that requires cookies.

2006-04-29 Thread John J. Lee
"mwt" <[EMAIL PROTECTED]> writes: > Fredrik Lundh wrote: [...] > > use urllib2 and cookielib. here's an outline: > > > > import urllib2, cookielib > > > > # set things up > > jar = cookielib.CookieJar() > > handler = urllib2.HTTPCookieProcessor(jar) > > opener = urllib2.build_

Re: urllib2 not support proxy on SSL connection?

2006-05-02 Thread John J. Lee
Heiko Wundram <[EMAIL PROTECTED]> writes: > Am Dienstag 02 Mai 2006 23:22 schrieb itay_k: > > Is it possible that urllib2 doesnt support for proxy over https > > connections? > > Are you sure this a proxy which is accessed by https, or rather a proxy that > supports CONNECT, and thus allows you

Re: Python & SSL

2006-05-02 Thread John J. Lee
James Stroud <[EMAIL PROTECTED]> writes: > I have been trying to make an https client with python, but it seems What exactly do you mean by "make an https client"? > that, to do this, one needs to have the socket module compiled with ssl. > This is not the default. So I have a couple of quest

Re: urllib2 not support proxy on SSL connection?

2006-05-02 Thread John J. Lee
Heiko Wundram <[EMAIL PROTECTED]> writes: > Am Dienstag 02 Mai 2006 23:22 schrieb itay_k: > > Is it possible that urllib2 doesnt support for proxy over https > > connections? > > Are you sure this a proxy which is accessed by https, or rather a proxy that > supports CONNECT, and thus allows you

Re: Python & SSL

2006-05-03 Thread John J. Lee
Benji York <[EMAIL PROTECTED]> writes: > James Stroud wrote: > > I have been trying to make an https client with python > > You probably don't want to use the standard library for HTTPS; here's a > quote from the socket module docs about SSL: > > Warning: This does not do any certificate

Re: Python & SSL

2006-05-04 Thread John J. Lee
Sybren Stuvel <[EMAIL PROTECTED]> writes: > John J. Lee enlightened us with: > > Of course, remembering that the first thing to ask in response to > > "is it secure?" is "against what?", for lots of purposes it just > > doesn't matter that it

Re: Python for Perl programmers

2006-05-04 Thread John J. Lee
"A.M" <[EMAIL PROTECTED]> writes: > Is there any efficient online resource or book that help experienced Perl > programmers to Python? Worry instead about how you're going to keep maintaining your Perl code after you've developed an allergic response to it. <0.5 wink> John -- http://mail.py

unittest.main-workalike that runs doctests too?

2006-05-05 Thread John J. Lee
...I wrote something to do this once, but didn't do as good a job as I might have done and wondered if anybody else has done it properly. I know about nose, but it seems just a little too magical for my tastes, and includes stuff I don't really need. John -- http://mail.python.org/mailman/list

Re: unittest.main-workalike that runs doctests too?

2006-05-05 Thread John J. Lee
Jay Parlar <[EMAIL PROTECTED]> writes: > On May 5, 2006, at 6:35 AM, John J. Lee wrote: [...] > > I know about nose, but it seems just a little too magical for my > > tastes, and includes stuff I don't really need. [...] > nose actually has very little

Re: unittest.main-workalike that runs doctests too?

2006-05-05 Thread John J Lee
On Fri, 5 May 2006, Benji York wrote: > John J. Lee wrote: >> ...I wrote something to do this once, but didn't do as good a job as I >> might have done and wondered if anybody else has done it properly. > > The Zope 3 project has zope.testing which has a very nice test

Re: Python for Perl programmers

2006-05-05 Thread John J. Lee
[EMAIL PROTECTED] (Alex Martelli) writes: > John J. Lee <[EMAIL PROTECTED]> wrote: > > > "A.M" <[EMAIL PROTECTED]> writes: > > > > > Is there any efficient online resource or book that help experienced Perl > > > programmers to Pyt

Re: Tuple assignment and generators?

2006-05-05 Thread John J. Lee
"vdrab" <[EMAIL PROTECTED]> writes: [...] > In fact, I think my code contains things like "if len(arg) is 0:" and > so on, So you made a mistake. It's OK, you can forgive yourself, nobody will notice > and I feel I should be able to do so given the way python treats > (claims to treat?) consta

Re: HTMLParseError: EOF in middle of construct error

2006-05-05 Thread John J. Lee
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: [...] > google:BeatifulSoup Even better, google for BeautifulSoup ^ John -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Eggs Just install in *ONE* place? Easy to uninstall?

2006-05-06 Thread John J. Lee
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > It appears that apps distributed as Python Eggs are either a single > compressed > blob in site-packages directory or a directory under site-packages > directory. > > Is this ALWAYS true? No. > So by just erasing stuff under site-packages > I c

Re: ftplib.ftpcp(), undocumented function?

2006-05-22 Thread John J. Lee
[EMAIL PROTECTED] writes: > Hi all, > I found this function recently when I read the source code of ftplib > module, I almost omit it at all and have tried to write it myself for > FXP work. > It seems exist long long ago, but never appeared in any document, > anyone knows why? > Is its implement

HTTPS client certificates (was Re: Twill question) (fwd)

2006-05-27 Thread John J Lee
Just forwarding this in case anybody here can shed light on this -- urllib's support for SSL client certificates didn't work for me, and I'm wondering if it works for anybody else... John -- Forwarded message -- Date: Sat, 27 May 2006 14:33:03 +0000 (UTC) F

Re: HTTPS client certificates (was Re: Twill question) (fwd)

2006-05-27 Thread John J Lee
On Sat, 27 May 2006, John J Lee wrote: > Just forwarding this in case anybody here can shed light on this -- urllib's > support for SSL client certificates didn't work for me, and I'm wondering if > it works for anybody else... > > > John > > -- F

Re: Print to end of line in a terminal

2008-02-27 Thread John J. Lee
ndlarsen <[EMAIL PROTECTED]> writes: > Hey. > > This might seem as a arbitrary question to some. Anyway, I'm wondering > how I go about printing text to the end of a line in a > terminal/console. I've been googling it for a few days without any > success. Any suggestions will be greatly appreciate

Re: How to build a body like this use SOAPPy?

2008-04-01 Thread John J. Lee
qgg <[EMAIL PROTECTED]> writes: [...] > [...] Heh, you may have picked an discouragingly spammish subject line. John -- http://mail.python.org/mailman/listinfo/python-list

Re: Why prefer != over <> for Python 3.0?

2008-04-01 Thread John J. Lee
"Gabriel Genellina" <[EMAIL PROTECTED]> writes: [...] >> There was a version of APL for the Sinclair QL which replaced the >> standard APL symbols with keywords. > > Wow, APL on 8 bits? > Now there is (or perhaps there was) J, a reincarnation of APL by > Iverson himself that uses ASCII characters

Re: Any fancy grep utility replacements out there?

2008-04-06 Thread John J. Lee
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > So I need to recursively grep a bunch of gzipped files. This can't be > easily done with grep, rgrep or zgrep. (I'm sure given the right > pipeline including using the find command it could be donebut > seems like a hassle). > > So I figured

Re: py.test and test coverage analysis ?

2008-04-06 Thread John J. Lee
j vickroy <[EMAIL PROTECTED]> writes: > Hello all, > > I am using py.test (http://codespeak.net/py/dist/test.html) to perform > unit testing. I would like to include test coverage analysis using > coverage.py (http://nedbatchelder.com/code/modules/coverage.html), but > I do not know how to simult

Re: str(bytes) in Python 3.0

2008-04-12 Thread John J. Lee
Christian Heimes <[EMAIL PROTECTED]> writes: > Gabriel Genellina schrieb: >> On the last line, str(x), I would expect 'abc' - same as str(x, 'ascii') >> above. But I get the same as repr(x) - is this on purpose? > > Yes, it's on purpose but it's a bug in your application to call str() on > a byt

Re: [wwwsearch-general] (no subject)

2008-08-29 Thread John J Lee
On Fri, 29 Aug 2008, bruce wrote: [...] does the page (test.html) need to be completely valid html? No, but there are certainly (poorly-defined) limitations. I haven't tried to understand your script or the HTML, but did you try this: br = mechanize.Browser(mechanize.RobustFactory()) ...

RE: [wwwsearch-general] (no subject)

2008-08-31 Thread John J Lee
On Fri, 29 Aug 2008, bruce wrote: Hi john. Thanks for your reply. I tried your suggestion of using RobustFactory, and still get a badly maligned html back!!! The html is listed below. I would That's expected -- this affects the parsing of the HTML. It does not modify the HTML. have thou

Re: [wwwsearch-general] python mechanize/libxml2dom question

2008-09-03 Thread John J Lee
On Mon, 1 Sep 2008, bruce wrote: [...] how can i [...] libxml2dom [...] Just a general point: try lxml.etree instead? Friendlier API. John -- http://mail.python.org/mailman/listinfo/python-list

Re: [wwwsearch-general] python - mechanize/browser/POST issue

2008-09-03 Thread John J Lee
On Tue, 2 Sep 2008, bruce wrote: [...] using mechanize/Browser, i can easily do a url/get, and process submitting a form that uses a GET as the action. however, I'm not quite sure how to implement the submittal of a form, that uses the POST action. [...] Same way as any other form. The HTTP me

Re: [wwwsearch-general] python/xpath question..

2008-09-03 Thread John J Lee
On Wed, 3 Sep 2008, bruce wrote: [...] and get the number of total nodes... by subtracting, i can get the number of nodes, without text.. is there an easier way??!! [...] Yes -- don't use XPath :-) John -- http://mail.python.org/mailman/listinfo/python-list

Re: Why property works only for objects?

2006-03-13 Thread John J. Lee
Michal Kwiatkowski <[EMAIL PROTECTED]> writes: [...] > "Return a property attribute for new-style classes". After reading a bit > about descriptors I've just assumed that property is a handy way to > create (any) descriptors. Learning that it only creates overriding > descriptors was a bit shocking

Re: COM Client / Server creation?

2006-03-22 Thread John J. Lee
"Dan" <[EMAIL PROTECTED]> writes: > Ive got the chapter from the net on COM. It looks pretty old, 2000. > Also the very first example in the chapter on COM doesn't seem to work. > Is what I am wanting to do possible with Python? As long as you're doing IDispatch, essentially anything is possible

Re: Spidering Hacks for Python, not Perl

2006-03-22 Thread John J. Lee
[EMAIL PROTECTED] writes: > O'Reilly's Spidering Hacks books terrific. One problem. All the code > samples are in Perl. Nothing Pythonic. Is there a book out there for > Python which covers spidering / crawling in depth? A fair number of the examples in that book use WWW::Mechanize. I ported tha

python-announce moderation (was: Re: ANN: ClientForm 0.2.2 released)

2006-03-23 Thread John J Lee
moderation software) forwarded it there after moderation, which isn't really necessary. John On Wed, 22 Mar 2006, John J Lee wrote: > http://wwwsearch.sourceforge.net/ClientForm/ > > This is the first stable release of ClientForm 0.2. > > (See below for the list of changes since

Re: python-announce moderation (was: Re: ANN: ClientForm 0.2.2 released)

2006-03-23 Thread John J. Lee
[EMAIL PROTECTED] (Aahz) writes: > In article <[EMAIL PROTECTED]>, > John J Lee <[EMAIL PROTECTED]> wrote: > > > >Hmm, [EMAIL PROTECTED], who are you? python-announce moderator? I > >didn't put you on my To: line (nor python-list for that matter, but

Re: python-announce moderation (was: Re: ANN: ClientForm 0.2.2 released)

2006-03-23 Thread John J. Lee
[EMAIL PROTECTED] (Aahz) writes: [...] > H hschilling is NOT one of the python-announce moderators, so I see. > zir e-mail setup is probably b0rken, accounting for all the problems you > mentioned. Could be. > I frequently send e-mail to python-announce, python-list, and > baypiggies

Re: Can't get the real contents form page in internet as the tag "no-chche"

2006-03-23 Thread John J. Lee
"dongdong" <[EMAIL PROTECTED]> writes: > oh~~~! offer my thanks to Tim Roberts and all persons above! > I see now, it's the different url causes! > contents can only be got from the later (real ) url. > I made a mistick not to look at the different urls taking effect. If you use ClientCooki

Re: COM Client / Server creation?

2006-03-24 Thread John J. Lee
[EMAIL PROTECTED] (John J. Lee) writes: [...] > Not covered in the book, and particularly useful for implementing > native clients and servers is ctypes / comtypes (but still not stable; > also, I've only personally used it for writing a client, and a very > simple one at

Re: __slots__

2006-03-25 Thread John J. Lee
[EMAIL PROTECTED] (Alex Martelli) writes: [...] > you should be using pychecker or pylint [...] I'm curious, as somebody who doesn't regularly use these tools: How do they fit into your workflow? Do you run them every few hours, every day, every time you run functional tests, every release, every

Re: Non-GUI source code browser with file system tree view

2006-03-30 Thread John J. Lee
bruno at modulix <[EMAIL PROTECTED]> writes: [...] > emacs + emacs code browser. + Tramp. (distributed with emacs, but it's good to know what documentation you need to be looking at) effbot's suggestion of rsync seems good though -- always assuming you can run rsync on the remote machine, of cour

Re: New Python website, new documentation ?

2006-03-30 Thread John J. Lee
Tim Parkin <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: > > >Hi, > > > >I was wondering : as there has been a change in python.org website with > >a new design, is it planned for the documentation section to be > >revamped as well ? If yes, would it be just a appearance renewal or > >wo

Re: urllib2 through basic auth'ed proxy

2006-03-30 Thread John J. Lee
Alejandro Dubrovsky <[EMAIL PROTECTED]> writes: [...] > How does one connect through a proxy which requires basic authorisation? > The following code, stolen from somewhere, fails with a 407: > [...code involving urllib2.ProxyBasicAuthHandler()...] > Can anyone explain me why this fails, or more i

Re: urllib2 through basic auth'ed proxy

2006-03-30 Thread John J. Lee
Alejandro Dubrovsky <[EMAIL PROTECTED]> writes: [...] > The proxy is squid. Python version is 2.3.4 (I read that this version has a > problem in that it introduces an extra return after the authorisation, but > it isn't even getting to that bit). And yes, going through firefox, > everything works

Re: Content Management System

2006-03-30 Thread John J. Lee
Jeff <[EMAIL PROTECTED]> writes: > Water Cooler v2 wrote: > > I know what it is, and yet the knowledge of what a CMS is, is so vague > > that I find myself asking this question every now and then. I've > > googled and read the resources too. However, the knowledge is still not > > clear. It is so

Re: Find similar images using python

2006-03-30 Thread John J. Lee
Richie Hindle <[EMAIL PROTECTED]> writes: > [Thomas] > > How can I use python to find images that looks quite similar? > > Have you looked at http://www.imgseek.net/ ? It's an Open Source Python photo > collection manager that does exactly what you're asking for. Maybe... I don't recall if it h

Re: urllib2 through basic auth'ed proxy

2006-03-31 Thread John J. Lee
Alejandro Dubrovsky <[EMAIL PROTECTED]> writes: > John J. Lee wrote: > > > FWIW, at a glance, Python 2.3.4 has neither of the bugs I mentioned, > > but the code I posted seems to work with 2.3.4. I'm not particularly > > interested in what's wrong

Re: urllib2 through basic auth'ed proxy

2006-04-01 Thread John J. Lee
[EMAIL PROTECTED] (John J. Lee) writes: > Alejandro Dubrovsky <[EMAIL PROTECTED]> writes: [...Alejandro complains about non-working HTTP proxy auth in urllib2...] [...John notes urllib2 bug...] > A workaround is to supply a stupid HTTPPasswordMgr that always returns > the pr

Re: Identifying filled circles in a scanned image

2006-04-01 Thread John J. Lee
Douglas Douglas <[EMAIL PROTECTED]> writes: > Hi everybody. > > I have a paper form that I scan into an image. My user fills some circles in > this paper form using black ink. Every form has ten rows with five circles > each > and the user fills only one circle for each row. > > I was wondering

Re: Connecting to gnuplot with Popen?

2006-04-01 Thread John J. Lee
Anton81 <[EMAIL PROTECTED]> writes: > > Hi Anton, > > > > here is a little snippet using os.popen: > > Unfortunately I'm having more problem getting the output from Gnuplot, which > I'd like to examine for error messages and settings of options. If you must roll your own, look at standard modul

Re: socket connetion to url with port 80

2006-04-04 Thread John J. Lee
"Sakcee" <[EMAIL PROTECTED]> writes: > I got the response using s.send("GET / HTTP/1.0\r\n\r\n"), > > but this socket is being blocked by squid server that we have installed > in our socket. You don't have squid installed "in your socket". You have it installed on a computer. Going through squ

Re: HTMLParser fragility

2006-04-10 Thread John J. Lee
"Lawrence D'Oliveiro" <[EMAIL PROTECTED]> writes: > I've been using HTMLParser to scrape Web sites. The trouble with this > is, there's a lot of malformed HTML out there. Real browsers have to be > written to cope gracefully with this, but HTMLParser does not. Not only > does it raise an except

Re: pre-PEP: The create statement

2006-04-11 Thread John J. Lee
"Michele Simionato" <[EMAIL PROTECTED]> writes: [...] > This agrees with my scan (except I also found an occurrence of 'create' > in Tkinter). > BTW, I would be curious to see the script you are using for the > scanning. Are you > using tokenize too? In am quite fond of the tokenize module ;) Havi

Re: XPath/Screen Scraping Gurus..

2006-04-11 Thread John J. Lee
"bruce" <[EMAIL PROTECTED]> writes: > I'm not that familiar with Pythin, but I wasn wondering if there are any > XPath/Python Gurus that I might be able to talk to regarding screen scraping > applications... Can you be more specific? John -- http://mail.python.org/mailman/listinfo/python-list

Re: XPath/Screen Scraping Gurus..

2006-04-11 Thread John J. Lee
Peter Hansen <[EMAIL PROTECTED]> writes: [...] > Screen-scraping refers, I believe, to the process of identifying what is > onscreen in GUI programs, possibly even at the pixel level, and trying > to translate that back into a higher level model (e.g. text in fields) > of what is going on. > >

Re: modifying html input date for mysql, reg ex or string interpolation?

2006-04-11 Thread John J. Lee
Kun <[EMAIL PROTECTED]> writes: [...] > mysqlstatement = "INSERT INTO dir (date, purchasetype, price, comment) > VALUES ('"+ date +"','"+ purchasetype +"','"+ price +"','"+ comment +"' )" [...] Haven't read your post carefully, but the first thing that jumps out at me is that you should be using

Re: modifying html input date for mysql, reg ex or string interpolation?

2006-04-11 Thread John J. Lee
Kun <[EMAIL PROTECTED]> writes: [...] > for x in form.keys(): > print "%s=%s" % (x, form[x].value) + "" [...] ...and the second thing that jumps out at me is that you're neglecting to HTML-quote the data you're inserting into your web page here (for example, using xml.sax.saxutils.escape()), w

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

2006-04-11 Thread John J. Lee
"Ju Hui" <[EMAIL PROTECTED]> writes: > I wanna use urllib2 to get a page with a socks 5 proxy,who can give me > a sample code ? [...] I haven't used it myself (though curiously, ftplib knows about this module and will use it if present -- and urllib2 uses ftplib to fetch ftp: URLs), but you could

Re: Python editing with emacs/wordstar key bindings.

2006-04-12 Thread John J. Lee
"Thomas Bartkus" <[EMAIL PROTECTED]> writes: [...] > >1) When I load a .py file, emacs automatically overrides my wordstar-mode > with python-mode, forcing all the keybindings back to emacs native keys. > Why? > > Why should a python-mode care what key bindings are in use? No idea. Quite od

Re: Python editing with emacs/wordstar key bindings.

2006-04-12 Thread John J. Lee
"Thomas Bartkus" <[EMAIL PROTECTED]> writes: [...] > >1) When I load a .py file, emacs automatically overrides my wordstar-mode > with python-mode, forcing all the keybindings back to emacs native keys. > Why? > > Why should a python-mode care what key bindings are in use? > >2) We get

Re: Python editing with emacs/wordstar key bindings.

2006-04-13 Thread John J. Lee
"Carl Banks" <[EMAIL PROTECTED]> writes: [...] > >1) When I load a .py file, emacs automatically overrides my wordstar-mode > > with python-mode, forcing all the keybindings back to emacs native keys. > > Why? [...] > Python and wordstar are both major modes. When python-mode is loaded, > it r

<    1   2   3   4   5