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
[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
"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
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
[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
"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
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
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
"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
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
"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':'
"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
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
"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
"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
[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
>
>
[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
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
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
"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
"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
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
>>
"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_
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
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
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
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
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
"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
...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
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
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
[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
"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
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes:
[...]
> google:BeatifulSoup
Even better, google for BeautifulSoup
^
John
--
http://mail.python.org/mailman/listinfo/python-list
"[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
[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
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
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
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
qgg <[EMAIL PROTECTED]> writes:
[...]
>
[...]
Heh, you may have picked an discouragingly spammish subject line.
John
--
http://mail.python.org/mailman/listinfo/python-list
"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
"[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
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
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
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())
...
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
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
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
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
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
"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
[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
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
[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
[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
"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
[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
[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
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
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
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
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
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
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
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
[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
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
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
"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
"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
"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
"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
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.
>
>
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
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
"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
"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
"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
"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
401 - 480 of 480 matches
Mail list logo