Re: Abandoning Python

2011-05-22 Thread John J Lee
Daniel Kluev writes: > On Sun, May 22, 2011 at 2:49 AM, John J Lee wrote: >> Here's my wishlist (not really in any order): > > How come pony is not listed there? Language cannot be better than > python without pony! Pony, absolutely. I took that as read. >>

Abandoning Python

2011-05-21 Thread John J Lee
I still like Python after using it for over a decade, but there are things I don't like. What are your favourite up-and-coming languages of the moment? Here's my wishlist (not really in any order): * A widely used standard for (optional) interface declaration -- or something better. I wan

Re: checking if a list is empty

2011-05-21 Thread John J Lee
Gregory Ewing writes: > Hans Georg Schaathun wrote: >> 0 is a number as real and existent as any other, >> one would think that the empty list is also as real and existent as >> any other list. > > 0 does have some special properties, though, such as > being the additive identity and not having

Re: Parsing a graph image

2011-05-21 Thread John J Lee
Bastian Ballmann writes: > Hi, > > the project sounds like the exact tool that i need but regarding the > user manual one has to mark the points on the graph manually. Therefore > it's more work to get the data out than doing it without a tool. Or may > I miss something here? > Greets Read the d

Re: application level monitoring for python

2011-05-21 Thread John J Lee
Walter Chang writes: > Hi > > is there any open source library for python that can allow application > level monitoring ? For example,application can send per request level/ > aggregated monitoring events and some remote server dump it and show > in the monitoring graph in real time ? What's be

Re: List of WindowsError error codes and meanings

2011-05-21 Thread John J Lee
Andrew Berg writes: > This is probably somewhat off-topic, but where would I find a list of > what each error code in WindowsError means? WindowsError is so broad > that it could be difficult to decide what to do in an except clause. > Fortunately, sys.exc_info()[1][0] holds the specific error co

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: [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 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] (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] (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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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

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: Python too complex ?!?!?!

2007-11-20 Thread John J. Lee
"Chris Mellon" <[EMAIL PROTECTED]> writes: [...] > These modules exist, but aren't that common. Certainly anything you're > likely to be using in an introductory compsci course is well packaged. > And even if it's not, it's really not that hard to create packages or > installers - a days work of co

Re: How can i find the form name without "nr=0"

2007-11-07 Thread John J. Lee
alex23 <[EMAIL PROTECTED]> writes: > On Nov 6, 8:56 am, scripteaze <[EMAIL PROTECTED]> wrote: >> Is it possible then to have a form with no name and if so, how can i >> access this form > > Hey scripteaze, > > I'm not sure about mechanize, but you might have more success using > another one of the

Re: urllib2 weirdness when https_proxy environment variable is exported

2007-10-27 Thread John J. Lee
Devraj <[EMAIL PROTECTED]> writes: > I have been extensively using Python's urllib2 while developing a > project with the Google Data API. The Google Data API uses httplib to > place all of its requests. However I have been using urllib2 and some > handlers that I discovered in an ASPN article to

Re: I can't get minimock and nosetests to play nice

2007-10-22 Thread John J. Lee
Matthew Wilson <[EMAIL PROTECTED]> writes: > I'm curious if anyone has ever tried using nosetests along with > minimock. This has nothing to do with nose. > I'm trying to get the two to play nice and not making progress. I > also wonder if I'm using minimock incorrectly. > > Here's the code I

Re: CGI Server that supports redirects

2007-10-22 Thread John J. Lee
Thomas Guettler <[EMAIL PROTECTED]> writes: > Hi, > > CGIHTTPServer does not support redirects[1] > > Is there an other python-only way to get a web server > running wich can execute python code? > > Since I already use flup[2]. I think there is not much > missing to get it serving as http server.

Re: negative base raised to fractional exponent

2007-10-17 Thread John J. Lee
[EMAIL PROTECTED] writes: [...] > Thank you for this. Now I need to somehow express this as a real > number. For example, I can transform the real and imaginary parts into > a polar coordinate giving me the value I want: > > z = sqrt( real_part**2 + imaj_part**2 ) > > but this is an absolute terms.

Re: urlgrabber cookie handling?

2007-10-17 Thread John J. Lee
Devraj <[EMAIL PROTECTED]> writes: > Hi everyone, > > I have been battling to make my code work with a HTTPS proxy, current > my code uses urllib2 to to most things and works well, except that > urllib2 doesn't handle HTTPS proxies. > > Urlgrabber (http://linux.duke.edu/projects/urlgrabber/help/ >

Re: Setting a timeout for a cookie

2007-10-16 Thread John J. Lee
Peter Bengtsson <[EMAIL PROTECTED]> writes: > On Oct 15, 4:09 pm, sophie_newbie <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I'm wondering how do you set a 'timeout' or expiry date/time for a >> cookie set using a python cgi script. I can set a cookie ok but I >> dunno how to set the expiry time so it

Re: urllib.ProxyHandler HTTPS issues

2007-10-13 Thread John J. Lee
Devraj <[EMAIL PROTECTED]> writes: > Thanks John. Will investigate sending the CONNECT command to handle > proxies. > > Do you recommend doing this for HTTP proxies as well No. > or should I just use the ProxyHandler for HTTP proxies? Yes. John -- http://mail.python.org/mailman/listinfo/pyt

Re: Finding Peoples' Names in Files

2007-10-11 Thread John J. Lee
brad <[EMAIL PROTECTED]> writes: > Crazy question, but has anyone attempted this or seen Python code that > does? For example, if a text file contained 'Guido' and or 'Robert' > and or 'Susan', then we should return True, otherwise return False. A few ideas: 1. If you don't have a list of names,

Re: How do I make urllib2 preserve case in HTTP header names?

2007-10-11 Thread John J. Lee
[EMAIL PROTECTED] writes: > The HTTP specification, RFC 2616, states that field names in HTTP > headers are case insensitive. But I'm trying to use Python 2.5.1's > urllib2 to interact with a web service offered by Amazon.com, which > deviates from the HTTP spec in that it requires use of case-se

Re: urllib.ProxyHandler HTTPS issues

2007-10-11 Thread John J. Lee
Devraj <[EMAIL PROTECTED]> writes: > Hi everyone, > > I have been reading various documents/posts on the web about handling > proxy options in urllib2. Some of them suggest that urllib2 doesn't > handle HTTPS and others say it does. I have successfully written code > that relays HTTP connections v

Re: Python and SSL

2007-10-03 Thread John J. Lee
Johny <[EMAIL PROTECTED]> writes: > On Oct 3, 2:17 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: >> > It looks like this >> >> > MyPythonProgram --->Proxy>Server You want MyPythonProgram being to be proxied by Proxy, using the HTTP CONNECT method? (CONNECT is a way of asking the proxy to j

Re: An Editor that Skips to the End of a Def

2007-09-23 Thread John J. Lee
Paul Rubin <http://[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] (John J. Lee) writes: >> > I think mousing takes more mental work than typing, >> I'm not sure this is a matter for debate, as much as physical >> measurement. > > I don't know of any w

Re: frange() question

2007-09-22 Thread John J. Lee
Carsten Haese <[EMAIL PROTECTED]> writes: > On Sat, 2007-09-22 at 07:27 +0000, John J. Lee wrote: >> Carsten Haese <[EMAIL PROTECTED]> writes: >> >> > On Thu, 2007-09-20 at 18:55 +, John J. Lee wrote: >> >> Functions are never generators, sens

Re: frange() question

2007-09-22 Thread John J. Lee
Carsten Haese <[EMAIL PROTECTED]> writes: > On Thu, 2007-09-20 at 18:55 +0000, John J. Lee wrote: >> Functions are never generators, senso stricto. There are "generator >> functions", which *return* (or yield) generators when you call them. > > Actually, a

Re: An Editor that Skips to the End of a Def

2007-09-22 Thread John J. Lee
Gary Coulbourne <[EMAIL PROTECTED]> writes: > John J. Lee wrote: >> Eclipse must be able to do this. > > Not by default... but I am certain there are plugins that provide python > integration. (And jython integration) Well yes, obviously (?) I meant Eclipse with pydev in

Re: An Editor that Skips to the End of a Def

2007-09-22 Thread John J. Lee
Paul Rubin <http://[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] (John J. Lee) writes: >> Seriously for a moment, I read something recently (maybe here?) about >> an Apple study that claimed to show that people who perceived keyboard >> bindings as being much faste

Re: Odd files; just left behind?

2007-09-22 Thread John J. Lee
Robin Becker <[EMAIL PROTECTED]> writes: > Bruno Desthuilliers wrote: > >>> >>> >>> >>> it would seem simpler to have the .so files inside the >>> site-packages and there's the question of why this folder has to be >>> obfuscated (name starts with .). Even if these files are >>> "resourc

Re: UTF-8 characters in doctest

2007-09-22 Thread John J. Lee
Peter Otten <[EMAIL PROTECTED]> writes: [...] >> Forgive me if this is a stupid question, but: What purpose does >> function f serve? > > Like the OP's get_inventary_number() it takes a unicode string and > returns a tuple of unicode strings. I'ts pointless otherwise. I hoped I > had stripped down

Re: UTF-8 characters in doctest

2007-09-20 Thread John J. Lee
Peter Otten <[EMAIL PROTECTED]> writes: [...] > # -*- coding: utf8 -*- > r""" f("äöü".decode("utf8")) > (u'\xe4\xf6\xfc',) > """ > def f(s): > return (s,) Forgive me if this is a stupid question, but: What purpose does function f serve? John -- http://mail.python.org/mailman/listinfo/p

Re: cannot create my own dict

2007-09-20 Thread John J. Lee
"A.T.Hofkamp" <[EMAIL PROTECTED]> writes: [...] > I can derive from dict, but the problem with that is that I start with a > read/write dictionary, and I can only hope to plug all holes to prevent my > data > from leaking out. > By starting from 'object', I certainly don't have that problem, I sta

Re: Python tickets summary

2007-09-20 Thread John J. Lee
"Facundo Batista" <[EMAIL PROTECTED]> writes: [...] > Based on an idea from Dennis Benzinger, now the temporal bars show the > moments where each comment was made, so it's easy to see the "rhythm" > of the ticket activity: > > http://www.taniquetil.com.ar/facundo/py_tickets.html I like that. I'

Re: An Editor that Skips to the End of a Def

2007-09-20 Thread John J. Lee
"W. Watson" <[EMAIL PROTECTED]> writes: > Thanks, but no thanks. The learning curve is way too steep. [...] Eclipse must be able to do this. Eclipse is emacs for stupid people ;-) Seriously for a moment, I read something recently (maybe here?) about an Apple study that claimed to show that peop

Re: frange() question

2007-09-20 Thread John J. Lee
George Trojan <[EMAIL PROTECTED]> writes: > A while ago I found somewhere the following implementation of frange(): > > def frange(limit1, limit2 = None, increment = 1.): > """ > Range function that accepts floats (and integers). > Usage: > frange(-2, 2, 0.1) > frange(10) >

Re: Odd files; just left behind?

2007-09-19 Thread John J. Lee
Robin Becker <[EMAIL PROTECTED]> writes: > I see a folder .python-eggs in my home directory on one of our servers > with various .so files > > ~/.python-eggs/MySQL_python-1.2.2-py2.3-freebsd-6.1-SECURITY-i386.egg-tmp/_mysql.so > > are these just left behind from some install process? Ah, it's abo

Re: Car-ac-systems

2007-09-11 Thread John J. Lee
"John Timney (MVP)" <[EMAIL PROTECTED]> writes: [...] > I like top posted threads, its my preferred response method - and actually [...] http://en.wikipedia.org/wiki/Apostrophe#English_language_usage John -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib2.urlopen(url) pulling something other than HTML

2007-08-21 Thread John J. Lee
Gabriel Genellina <[EMAIL PROTECTED]> writes: [...] > Don't even try to understand it - it's a mess. Use the HTMLParser > module instead. [...] Module sgmllib (and therefore module htmllib also) is more tolerant of bad HTML than module HTMLParser. John -- http://mail.python.org/mailman/listinfo

Re: desperately in need of a tool

2007-08-20 Thread John J. Lee
yagyala <[EMAIL PROTECTED]> writes: > I recently started working for a company that has just implemented its > first set of software standards. So far, so good. Here's the problem: > one of those standards is that the comments for each routine must > indicate every other routine that it calls. As

Re: desperately in need of a tool

2007-08-20 Thread John J. Lee
yagyala <[EMAIL PROTECTED]> writes: > I recently started working for a company that has just implemented its > first set of software standards. So far, so good. Here's the problem: > one of those standards is that the comments for each routine must > indicate every other routine that it calls. As

Re: urllib2.urlopen(url) pulling something other than HTML

2007-08-20 Thread John J. Lee
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: [...] > -- > f = formatter.AbstractFormatter(formatter.DumbWriter(StringIO())) > parser = htmllib.HTMLParser(f) > parser.feed(html) > parser.close() > return parser.anchorlist > -

Re: Seek the one billionth line in a file containing 3 billion lines.

2007-08-12 Thread John J. Lee
"Chris Mellon" <[EMAIL PROTECTED]> writes: [...] > The minimum bounds for a line is at least one byte (the newline) and > maybe more, depending on your data. You can seek() forward the minimum > amount of bytes that (1 billion -1) lines will consume and save > yourself some wasted IO. But how do y

Re: cookielib

2007-08-11 Thread John J. Lee
Boris Ozegovic <[EMAIL PROTECTED]> writes: > Hi > > I have HTTP client which accepts cookies. If client allready has cookie, > but that cookie has expired, server sends him new cookie, and in response > object Set-Cookie: header everything is fine, but if I reload request, > client sends expired

Re: Screenscraping, in python, a web page that requires javascript?

2007-08-09 Thread John J. Lee
Dan Stromberg - Datallegro <[EMAIL PROTECTED]> writes: > Is there a method, with python, of screenscraping a web page, if that web > page uses javascript? Not pure CPython, no. > I know about BeautifulSoup, but AFAIK at this time, BeautifulSoup is for > HTML that doesn't have embedded javascrip

Re: Misleading wikipedia article on Python 3?

2007-08-07 Thread John J. Lee
"Martin v. Löwis" <[EMAIL PROTECTED]> writes: >> Do you *really* think that projects will fall 50-50 into the "yes" and >> "no" camps, as you seem to imply -- after all, if you thought that one >> case was more common, why wouldn't you mention which it was? > > I know you didn't ask me this time,

Re: ensuring GNU readline isn't used

2007-08-07 Thread John J. Lee
Duncan Booth <[EMAIL PROTECTED]> writes: > Josh Paetzel <[EMAIL PROTECTED]> wrote: > >> Is there a way to ensure that GNU readline isn't used (even though >> support may have been compiled in?). I'm experiencing a licensing >> problem, I'd like to use the "cmd" module, for example, but my code is

Re: Misleading wikipedia article on Python 3?

2007-08-07 Thread John J. Lee
Carsten Haese <[EMAIL PROTECTED]> writes: > On Sun, 2007-08-05 at 23:09 +0000, John J. Lee wrote: >> I just wanted to know: is it easy to make my code so it >> runs on 2.6 and 3.0, without funny stuff like a code translator? > > That depends on your definitions of &q

re: mmm-mode, python-mode and doctest-mode?

2007-08-07 Thread John J Lee
On Tue, 7 Aug 2007, Edward Loper wrote: > [John J Lee] >> Is it possible to get doctest-mode to work with mmm-mode and python-mode >> nicely so that docstrings containing doctests are editable in doctest-mode? > > I recently released a new version of doctest-mode [1], a

Re: Misleading wikipedia article on Python 3?

2007-08-05 Thread John J. Lee
"Martin v. Löwis" <[EMAIL PROTECTED]> writes: [... snip stuff I don't follow ...] > However, it *is* a design goal to make 2.6 so that transition to > 3k becomes simpler. That's not a 3k feature, but a 2.6 one. Not sure I care about this sort of thing for the purpses of my question. I just wanted

Re: A question on plugin design

2007-08-05 Thread John J. Lee
[EMAIL PROTECTED] (John J. Lee) writes: > Grzegorz Słodkowicz <[EMAIL PROTECTED]> writes: > [...] >> I'd also be grateful for pointers to a well designed Pythonic plugin >> architecture but I'd much prefer a small project with a simple API. > > Google for

Re: Misleading wikipedia article on Python 3?

2007-08-05 Thread John J. Lee
"Martin v. Löwis" <[EMAIL PROTECTED]> writes: >> I'm surprised to read this: >> >> http://en.wikipedia.org/wiki/Python_3 >> >> """Note that while there is no explicit requirement that code be able >> to run unmodified in both versions, in practice it is quite likely for >> most code. As of Janua

Misleading wikipedia article on Python 3?

2007-08-05 Thread John J. Lee
I'm surprised to read this: http://en.wikipedia.org/wiki/Python_3 """Note that while there is no explicit requirement that code be able to run unmodified in both versions, in practice it is quite likely for most code. As of January 2007, it looks like most reasonable code should run quite well un

Re: A question on plugin design

2007-08-05 Thread John J. Lee
Grzegorz Słodkowicz <[EMAIL PROTECTED]> writes: [...] > I'd also be grateful for pointers to a well designed Pythonic plugin > architecture but I'd much prefer a small project with a simple API. Google for setuptools and Python eggs. Search for "entry point" on the setuptools page. John -- htt

Re: UK Ordnance survey coordinates and Geocoding anyone ?

2007-08-01 Thread John J. Lee
Ken Starks <[EMAIL PROTECTED]> writes: [...] > http://www.magic.gov.uk/ [snip rest of URL...] Cool, I had no idea we still had a department of magic! I'll keep my eyes peeled for Mr. Norrell... John -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic way for missing dict keys

2007-08-01 Thread John J. Lee
Steve Holden <[EMAIL PROTECTED]> writes: [...] > Yup. Anyway there's a trivial translation for uses of apply. > > apply(f, *args, **kw) => f(*args, **kw) [...] Steve means: apply(f, args, kw) => f(*args, **kw) John -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic way for missing dict keys

2007-07-28 Thread John J. Lee
Alex Popescu <[EMAIL PROTECTED]> writes: > Zentrader <[EMAIL PROTECTED]> wrote in news:1185041243.323915.161230 > @x40g2000prg.googlegroups.com: > >> On Jul 21, 7:48 am, Duncan Booth <[EMAIL PROTECTED]> wrote: >> >> [snip...] >> >> >>>From the 2.6 PEP #361 (looks like dict.has_key is deprecated)

Re: slow emails

2007-07-28 Thread John J. Lee
Gabriel Dragffy <[EMAIL PROTECTED]> writes: > Whenever I post to this list my email invariably takes ages to show > up - perhaps two days or so. Often times not at all. Why is this? > > I am subscribed to Ubuntu mail list which is also high traffic, and > my posts show up there within minutes. N

Re: ANN: Snobol 1.0

2007-07-26 Thread John J. Lee
(Sorry if this appears twice, accidentally included c.l.py.announce the first time where it was (correctly) rejected, not sure if that means it didn't get through to c.l.py either). greg <[EMAIL PROTECTED]> writes: > Aahz wrote: >> So adding >> SNOBOL patterns to another library would be a wonder

Re: Singleton in Python Cookbook

2007-07-25 Thread John J. Lee
Alex Popescu <[EMAIL PROTECTED]> writes: > Hi all! > > I was reading through Python Cookbook the Singleton recipe. At this moment > I am a bit puzzled as the example in the book is not working resulting in: > > TypeError: type.__new__(SingleSpam): SingleSpam is not a subtype of type Haven't look

Re: Singleton in Python Cookbook

2007-07-25 Thread John J. Lee
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: [...] > AFAIK the cookbook is completely found online at ASPN. So no sweat > publishing it here. [...] No: the book-form cookbook is edited, and has extra text. I believe the recipes are under a BSD-style license, though. John -- http://mail.pytho

Re: how to find available classes in a file ?

2007-07-22 Thread John J. Lee
Alex Popescu <[EMAIL PROTECTED]> writes: [...] > I may be wrong but I think I've found a difference between my > dir(module) approach > and the inspect.getmembers(module, inspect.isclass): the first one > returns the > classes defined in the module, while the later also lists the imported > availab

Re: code packaging

2007-07-21 Thread John J. Lee
Paul Rubin writes: [...] > I'm now wondering where this type of thing is best addressed in more > general terms. What I usually see happening, in projects I've worked > on and in others, is that developers get the code working on their own > computers, using source contr

Re: urllib to cache 301 redirections?

2007-07-16 Thread John J Lee
On Tue, 17 Jul 2007, O.R.Senthil Kumaran wrote: [...] > I spent a little time thinking about a solution and figured out that the > following changes to HTTPRedirectHandler, might be helpful in implementing > this. [...] Did you post it on the Python SF patch tracker? If not, please do, and point

Re: Client-side cookies on Python in Mac OSX

2007-07-14 Thread John J. Lee
Adrian Petrescu <[EMAIL PROTECTED]> writes: > Oh, you're right! Silly me, I had always thought it was standard. > Thanks for pointing this out! I went and downloaded ClientCookie and > it works great on OS X. And since it is BSD-licensed, I can use it in > my app without any fear. Perfect. > > Tha

Re: Can a low-level programmer learn OOP?

2007-07-14 Thread John J. Lee
[EMAIL PROTECTED] (Aahz) writes: [...] > Note very very carefully that Python does not require an OOP style of > programming, agree > but it will almost certainly be the case that you just > naturally start using OOP techniques as you learn Python. There's some truth to this. But stagnation is

Re: Can a low-level programmer learn OOP?

2007-07-14 Thread John J. Lee
[Chris Carlen] > From what I've read of OOP, I don't get it. I have also found some > articles profoundly critical of OOP. I tend to relate to these > articles. If you want to know the truth, and opt to neither trust a friend or colleague, nor spend the time to try it yourself, here's a third w

Re: help reading cookie values

2007-07-14 Thread John J. Lee
[EMAIL PROTECTED] writes: > On Jul 13, 3:08 pm, Sean <[EMAIL PROTECTED]> wrote: >> I am trying to read a cookie I set but I am not sure if I really set >> it correctly or I am not reading it correctly. I was given the >> following instructions to set the cookie. It appears to be working >> becau

Re: Passing a CookieJar instead of a cookieproc to urllib2.build_opener

2007-07-11 Thread John J. Lee
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: [...] > Are the docs themselves in subversion? I suppose I should also update > the doc at http://docs.python.org/lib/module-urllib2.html Yep: http://svn.python.org/projects/python/trunk/Doc/lib/liburllib2.tex John -- http://mail.python.org/mail

Re: socket.makefile() buggy?

2007-07-10 Thread John J. Lee
Steve Holden <[EMAIL PROTECTED]> writes: > ahlongxp wrote: >> On Jul 8, 9:54 pm, Steve Holden <[EMAIL PROTECTED]> wrote: >>> That's a pretty pejorative subject line for someone who's been >>> programming Python [guessing by the date of your first post] for about a >>> month. >>> > [...] >> And las

Re: What is the most efficient way to test for False in a list?

2007-07-10 Thread John J. Lee
Duncan Booth <[EMAIL PROTECTED]> writes: > Paul Rubin wrote: > >> "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: >>> >> status = all(list) >>> > >>> > Am I mistaken, or is this no identity test for False at all? >>> >>> You are mistaken. all take an iterable and return

Re: Tool for finding external dependencies

2007-07-10 Thread John J. Lee
Rob Cakebread <[EMAIL PROTECTED]> writes: > Hi, > > I need to find external dependencies for modules (not Python standard > library imports). > > Currently I use pylint and manually scan the output, which is very > nice, or use pylint's --ext-import-graph option to create a .dot file > and extract

Re: Passing a CookieJar instead of a cookieproc to urllib2.build_opener

2007-07-10 Thread John J. Lee
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > urllib2.build_opener happily accepts and ignores a FileCookieJar.I > had a bug in my code which looked like > > urllib2.build_opener(func_returning_cookie_jar()) > > which should have been > > urllib2.build_opener(HTTPCookieProcessor(func_retur

Re: Purpose of delayload in cookielib.FileCookieJar?

2007-07-10 Thread John J. Lee
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > What is the reason for delayload=False in the FileCookieJar.__init__ > function? It doesn't seem to be used in any of the code that ships > with python2.4, That is true, as is in fact explicitly documented: http://docs.python.org/lib/cookie-jar-

Re: Pretty Printing Like Tidy for HTML

2007-07-08 Thread John J. Lee
David <[EMAIL PROTECTED]> writes: > Is there a pretty printing utility for Python, something like Tidy for > HTML? > > That will change: > > xp=self.uleft[0]+percentx*(self.xwidth) > > To: > > xp = self.uleft[0] + percentx * (self.xwidth) > > And other formatting issues. Googled a

Re: IDEs for COM scripting: C# v. Python v. Iron Python v. JPython

2007-07-06 Thread John J. Lee
"Méta-MCI" <[EMAIL PROTECTED]> writes: [...] > And, all COM-servers builds with Python are dynamic-COM-server. Not true. Look for "comtypes" on this page: http://python.net/crew/theller/ctypes/ [...] > about Iron Python: is there a good IDE for it that has a typing assist? MS calls this "typin

Re: urllib to cache 301 redirections?

2007-07-06 Thread John J. Lee
"O.R.Senthil Kumaran" <[EMAIL PROTECTED]> writes: > Hi, > There is an Open Tracker item against urllib2 library python.org/sf/735515 > which states that. > urllib / urllib2 should cache the results of 301 (permanent) redirections. > This shouldn't break anything, since it's just an internal optimi

Re: deliberate versus os socket timeout

2007-07-05 Thread John J. Lee
Robin Becker <[EMAIL PROTECTED]> writes: > While messing about with some deliberate socket timeout code I got an > unexpected timeout after 20 seconds when my code was doing > socket.setdefaulttimeout(120). > > Closer inspection revealed that this error in fact seemed to come from > the os (in thi

Re: using urllib, urllib2 , mechanize to access password protected site

2007-07-01 Thread John J. Lee
comeshopcheap <[EMAIL PROTECTED]> writes: > Hi > > I am using this script to access doba.com (I need to download some > files) but I keep on being sent back to the login page not the user > home page. Any help. I think I may need to use a post method and > opener is using a get method > > Thanks >

Re: something similar to shutil.copytree that can overwrite?

2007-06-26 Thread John J. Lee
Ben Sizer <[EMAIL PROTECTED]> writes: > On 20 Jun, 11:40, Justin Ezequiel <[EMAIL PROTECTED]> > wrote: >> On Jun 20, 5:30 pm, Ben Sizer <[EMAIL PROTECTED]> wrote: >> >> > I need to copy directories from one place to another, but it needs to >> > overwrite individual files and directories rather th

Re: What was that web interaction library called again?

2007-06-25 Thread John J. Lee
Harald Korneliussen <[EMAIL PROTECTED]> writes: > Hi, > > I remember I came across a python library that made it radically > simple to interact with web sites, connecting to gmail and logging in > with four or five lines, for example. I thought, "that's interesting, > I must look into it sometime"

Re: urllib interpretation of URL with ".."

2007-06-25 Thread John J. Lee
John Nagle <[EMAIL PROTECTED]> writes: > Duncan Booth wrote: >> "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: >> >> Is "urllib" wrong? > >> Section 5.2 is also relevant here. In particular: >> >> >>> g) If the resulting buffer string still begins with one or more >>> complete path

Re: eggs considered harmful

2007-06-25 Thread John J. Lee
Harry George <[EMAIL PROTECTED]> writes: > Robert Kern <[EMAIL PROTECTED]> writes: [...] > This is a possibility. The tarballs can be seen in a directory > listing. They are in different subdirs (for different "bundles" of > functionality), so I'll need -f to look several places. One possibilit

Re: Setuptools, build and install dependencies

2007-06-25 Thread John J. Lee
Harry George <[EMAIL PROTECTED]> writes: > Robert Kern <[EMAIL PROTECTED]> writes: > >> Harry George wrote: >> >>> We need to know the dependencies, install them in dependency order, >>> and expect the next package to find them. "configure" does this for >>> hundreds of packages. cmake, scons, a

Re: eggs considered harmful

2007-06-25 Thread John J. Lee
Harry George <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] (John J. Lee) writes: [...] >> 2. You can run your own private egg repository. IIRC, it's as simple >> as a directory of eggs and a plain old web server with directory >> listings turned on.

Re: Indenting in Emacs

2007-06-25 Thread John J. Lee
Michael Hoffman <[EMAIL PROTECTED]> writes: > John J. Lee wrote: >> Eugene Morozov <[EMAIL PROTECTED]> writes: >> >>> Steven W. Orr пишет: >>> > Ok. I'm not stupid but I do not see a 4.78 anywhere even though I >>> see refs >&g

  1   2   3   4   5   >