Re: Are Python's reserved words reserved in places they dont need to be?

2006-09-12 Thread Cliff Wells
d hacks in to work around it (an easy one would be to prefix autogenerated attributes, which also helps work around the lack of private attributes in Python). Whether or not this should be changed is tangential to the OP's point. It must be a bit frustrating to state the obvious over and over and see it misinterpreted each time. Python has shortcomings. This is one of them, whether there's valid reasons for it or not. It's better to acknowledge it and offer something useful rather than "that isn't the Python way, don't do it." Cliff -- -- http://mail.python.org/mailman/listinfo/python-list

Python blogging software

2006-09-13 Thread Cliff Wells
ne aware of any functional (doesn't need to be complete, beta is fine) blog software written in Python? Regards, Cliff -- -- http://mail.python.org/mailman/listinfo/python-list

Re: Python blogging software

2006-09-13 Thread Cliff Wells
On Wed, 2006-09-13 at 00:29 -0700, Cliff Wells wrote: > Anyone aware of any functional (doesn't need to be complete, beta is > fine) blog software written in Python? Hmph. And as soon as I hit send I find http://wiki.python.org/moin/PythonBlogSoftware Okay, so is there any *n

Re: Python blogging software

2006-09-13 Thread Cliff Wells
On Wed, 2006-09-13 at 08:22 -0700, Fuzzyman wrote: > Cliff Wells wrote: > > On Wed, 2006-09-13 at 00:29 -0700, Cliff Wells wrote: > > > > > Anyone aware of any functional (doesn't need to be complete, beta is > > > fine) blog software written in Python? >

Re: Are Python's reserved words reserved in places they dont need to be?

2006-09-13 Thread Cliff Wells
t; > patch here: > > http://mail.python.org/pipermail/python-list/2001-June/047996.html Did you happen to remember this post or is Google *really* your friend? Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: Python blogging software

2006-09-14 Thread Cliff Wells
On Wed, 2006-09-13 at 19:28 +0200, Irmen de Jong wrote: > Cliff Wells wrote: > > I'm currently using Frog, and it's decent, but lacks some fundamental > > features (tags for one). Since Irmen is probably going to scrap it > > anyway, I'm kind of fishing about

Re: Why not event-driven packages in other than the main thread?

2006-09-14 Thread Cliff Wells
work with threads: http://docs.python.org/lib/module-signal.html Regards, Cliff -- -- http://mail.python.org/mailman/listinfo/python-list

Re: Why not event-driven packages in other than the main thread?

2006-09-14 Thread Cliff Wells
On Thu, 2006-09-14 at 03:22 -0700, Cliff Wells wrote: > They probably use signals (Twisted I'm sure does) and it's documented > that signals don't work with threads: > > http://docs.python.org/lib/module-signal.html Er, specifically, they only work with the main t

Python extensions on Win32

2006-09-25 Thread Cliff Wells
? 4) How much alcohol will be required to forget all this when I'm done? Thanks, Cliff -- -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-11 Thread Cliff Wells
p may have expression-based syntax and macros, but it's also got Eric Naggum. If we can't have the nice features of Lisp, let's at least not adopt its downsides. Regards, Cliff P.S. As a disclaimer, I *have* had a few beers tonight already and have, in fact, been binge-coding

Re: merits of Lisp vs Python

2006-12-11 Thread Cliff Wells
ant whitespace in Python but let's not pretend there isn't at least a small penalty. And I strongly suspect Python's varied syntactical rules impose far more of a "load" on code editors than Lisp does (it certainly offers more opportunity for the editor to do the wrong thing). Regards, Cliff > -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-11 Thread Cliff Wells
lities? Which method should be called? Better to explicitly call the desired method. Multimethods may make sense in many languages but not so much in Python. Regards, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: template engine

2007-01-13 Thread Cliff Wells
nterest you: http://breve.twisty-industries.com Regards, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: Type casting a base class to a derived one?

2007-01-24 Thread Cliff Wells
designed to not dispatch based on type, but quite frankly it works quite elegantly and naturally for everything but this one case. Just pointing out that just because we don't see a need for something doesn't invalidate it. It just makes it something we had thought of ;-) Regards, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: Type casting a base class to a derived one?

2007-01-24 Thread Cliff Wells
luctant to claim it would never be of use. > I agree, but without a use case it's hard to understand the limits and > needs of a requirement. So if you can't think of a need for a feature, > it becomes difficult to understand how you might implement that > feature. Certainly. Several years of using Python has never suggested a use to me prior to this. Regards, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: Type casting a base class to a derived one?

2007-01-24 Thread Cliff Wells
On Wed, 2007-01-24 at 11:37 -0800, Cliff Wells wrote: > > class Person: # assume this is something from the ORM > name = "Kenny" > > class PersonRow ( Person ): > pass > > def flatten_person ( p ): > return "omg, you've kil

Re: ANN: Dejavu 1.5.0RC1

2007-01-24 Thread Cliff Wells
On Wed, 2007-01-24 at 14:57 -0800, Robert Brewer wrote: > 1. Expressions: pure Python lambda querying. This is perhaps the most >appealing feature of Dejavu. Actually I just went and looked and personally I find the documentation the most appealing feature. Regards, Cliff --

Re: How to sort using hash's key?

2007-01-31 Thread Cliff Wells
ipe/438823 > 3webXS HiSpeed Dial-up...surf up to 5x faster than regular dial-up alone... > just $14.90/mo...visit www.get3web.com for details You pay $15/mo for dialup??? Regards, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: Python launcher not working on Mac after Leopard upgrade?

2007-11-06 Thread Cliff Harris
On Nov 5, 11:57 am, [EMAIL PROTECTED] wrote: > On Nov 3, 7:57 am, André <[EMAIL PROTECTED]> wrote: > > > I just installed Leopard on my Mac. I already was using Python 2.5. > > I can run a Python script from a terminal window by typing "python > > script.py" as one would expect ... but not using

Re: Some "pythonic" suggestions for Python

2007-11-09 Thread Cliff Wells
e). Unfortunately it's nowhere near Python in completeness (notably documentation, size of community and overall maturity) and, for better or worse, it runs on .NET/Mono. Regards, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: Is anyone happy with csv module?

2007-12-11 Thread Cliff Wells
odule was deemed appropriate for inclusion in the standard libraries. Whether or not anyone agrees with this point of view is now mostly irrelevant, since *by definition* the Python csv module intends to implement a protocol. Other implementations remain free to vary in their definition of CSV. Regards, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: Is anyone happy with csv module?

2007-12-14 Thread Cliff Wells
I admit looking at the source won't make you think so ;-) Regards, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: syntax color lang source code in blogs or website

2009-01-25 Thread Cliff MacGillivray
Xah Lee wrote: For those of you using emacs, here's the elisp code that allows you to syntax color computer language source code in your blog or website. http://xahlee.org/emacs/elisp_htmlize.html to comment, here: http://xahlee.blogspot.com/2009/01/dehtmlize-source-code-in-emacs-lisp.html Xah

PureMVC Python / Google App Engine Demo - Blog

2008-04-15 Thread Cliff Hall
://trac.puremvc.org/Demo_Python_GoogleAppEngine_Blog -=Cliff> -- http://mail.python.org/mailman/listinfo/python-list

Re: Default parameter for a method

2008-04-16 Thread Cliff Wells
arg = self.meth1() > > > > but I'm looking for a more straightforward way. > > You can write this as: > > def meth2(self, arg=None): > arg = arg or self.meth1() > > IMHO - You can't get much more "straightforward" than that. What if arg is 0 an empty list or anything else that's "False"? def meth2(self, arg=None): arg = (arg is not None) or self.meth1() is what you want. Regards, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Trouble importing cx_Oracle on HPUX

2010-08-26 Thread Cliff Martin
hould work, but there is not a lot of people doing this or posting notes about their install problems or successes on HP-UX. Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: Trouble importing cx_Oracle on HPUX

2010-08-28 Thread Cliff Martin
this work?). Python -v did, however, and it came up with a number of unresolved symbols all seeming to be from libnnz11.so. I tried linking against all of the *.so files in ORACLE_HOME/lib, but I don't remember trying libttsh11 specifically. I will try it again on Monday. -- Cliff On Sat, A

Re: Trouble importing cx_Oracle on HPUX

2010-08-30 Thread Cliff Martin
including libttsh11 fixed the problem. Thank you! Now I can get on with fixing everything that Python 3 broke... err changed. :) -- Cliff On Sat, Aug 28, 2010 at 11:20 AM, Alexander Gattin wrote: > Hello, > > On Sat, Aug 28, 2010 at 09:27:05AM -0400, Cliff > Martin wrote:

Re: Generator vs functools.partial?

2012-06-21 Thread J. Cliff Dyer
On Thu, 2012-06-21 at 21:25 +1000, John O'Hagan wrote: > Sometimes a function gets called repeatedly with the same expensive argument: > > def some_func(arg, i): > (do_something with arg and i) > > same_old_arg = big_calculation() > for i in lots_of_items: > some_func(same_old_arg, i) >

List comprehension/genexp inconsistency.

2012-03-20 Thread J. Cliff Dyer
as discovered in python 2.6. In python 3.2, both versions fail with the same NameError. Obviously, this is easy enough to work around. I'm curious though: What's going on under the hood to cause the nested generator expression to fail while the list comprehension succeeds? Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: List comprehension/genexp inconsistency.

2012-03-21 Thread J. Cliff Dyer
Binding" http://www.python.org/dev/peps/pep-0289/#early-binding-versus-late-binding Cheers, Cliff On Tue, 2012-03-20 at 16:50 -0600, Ian Kelly wrote: > On Tue, Mar 20, 2012 at 3:16 PM, Dennis Lee Bieber > wrote: > > On Tue, 20 Mar 2012 16:23:22 -0400,

Re: Best way to disconnect from ldap?

2012-03-21 Thread J. Cliff Dyer
Write a context manager. Then you just do with MyLDAPWrapper() as ldap ldap.this() ldap.that() and when you leave the scope of the with statement, your ldap __exit__ method will get called regardless of how you left. Cheers, Cliff On Wed, 2012-03-21 at 19:30 +, John Gordon wrote

Re: Python classes: Simplify?

2012-03-22 Thread J. Cliff Dyer
2008/10/why-explicit-self-has-to-stay.html Cheers, Cliff On Thu, 2012-03-22 at 13:15 +, Andrea Crotti wrote: > On 03/22/2012 10:51 AM, Steven Lehar wrote: > > It seems to me that the Python class system is needlessly confusing. > > Am I missing something? > > > >

Re: Is there any difference between print 3 and print '3' in Python ?

2012-03-26 Thread J. Cliff Dyer
hen format them using standard string formatting operations when you want to print them. There's more information on how to do formatting here: http://docs.python.org/library/stdtypes.html#string-formatting Cheers, Cliff On Mon, 2012-03-26 at 04:45 -0700, redstone-c...@163.com

Re: help needed to understand an error message.

2012-03-30 Thread J. Cliff Dyer
u've created the next token, a string literal, that the parser discovers the error: you can't have a string literal following a variable. *You* think your error is that you misspelled "print." The parser thinks your error is trying to put a string literal next to a variable.

Re: I look for a package to make some simple console "form"

2012-04-02 Thread J. Cliff Dyer
data into useful python objects, and from python objects to displayable values. http://www.formencode.org/en/latest/Validator.html Might be what you're looking for. Cheers, Cliff On Mon, 2012-04-02 at 14:55 +0200, Stéphane Klein wrote: > Hi, > > I look for a package to make

Re: Interprocess comunication

2012-06-07 Thread J. Cliff Dyer
On Thu, 2012-06-07 at 16:04 +, Julio Sergio wrote: > Up to this point it worked as expected. However, when I tryied with the > methods > that write and read several lines, apparently the process got stalled: > > ->>> fi.writelines(["uno\n","dos\n","tres\n"]) > ->>> fi.flush() > ->>> s = fo.

Re: Interprocess comunication

2012-06-07 Thread J. Cliff Dyer
It is for reading all the lines from a complete file. If the file is still being written to, it doesn't have an end yet. File objects do many things besides RPC. Also, there are instances where all you want to do is block until the file is done, and then get all the content. readlines will do th

Re: Academic citation of Python

2012-06-16 Thread J. Cliff Dyer
source code at a given revision. Cheers, Cliff On Sat, 2012-06-16 at 13:24 +1000, Mark Livingstone wrote: > Hello! > > I wish to properly cite Python in an academic paper I am writing. > > Is there a preferred document etc to cite? > > Thanks in advance, > >

Re: How to optimise this code?

2007-08-21 Thread J. Cliff Dyer
end(testCase1) testCaseList.append(testCase2) for testCase in testCaseList: testCase() Also, as python allows direct iteration over a list, you'll find that you don't need to create loops on an incrementor variable. Just loop on the list itself. I suspect lambda might be

Re: for statement on empty iterable

2007-08-22 Thread J. Cliff Dyer
Neil Cerutti wrote: On 2007-08-22, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: While it is desireable to not only write working, but also aesthetically pleasing code, as a beginner you shouldn't worry too much. The sense of aesthetics develops with time. Important is to try and grasp the idio

Re: creating a tar file with python

2007-08-24 Thread J. Cliff Dyer
r unclosed quotes, parens, brackets, etc. becomes second nature. And make sure you quote ALL strings. Some languages are forgiving on this count. Python is not. Blessings to all, and may all find their good cheer restored by some rest. I offer you both a virtual pint. You seem like you could use it. Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Regular Expresions to change .htm to .php in files

2007-08-24 Thread J. Cliff Dyer
Tim Williams wrote: On 23/08/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hi, I have a bunch of files that have changed from standard htm files to php files but all the links inside the site are now broken because they point to the .htm files while they are now .php files. Does anyone h

Re: Using Regular Expresions to change .htm to .php in files

2007-08-24 Thread J. Cliff Dyer
'.htm','.php') I make no claims about what the surrounding code should look like. You've gotten a number of responses on that already. Cheers, Cliff Sébastien N wrote: It's a fact, but still I went on with the solution that overwrites all the .htm because i

Re: How to replace a method in an instance.

2007-08-24 Thread J. Cliff Dyer
h > but since in the real world, CC inherits from his baseclass, the above > assignment causes the baseclass to be altered. :-( > > Please tell me if I need to provide more. > > Is there a reason you don't just create a subclass for the one that needs to call repmeth? class CC(object): def m1(self): print "m1" def m2(self): print "m2" class SpecialCC(CC): def m1(self): print "something else!" if __name__ == '__main__': a = CC() b = SpecialCC() for instance in a, b: instance.m1() instance.m2() --Output-- m1 m2 something else! m2 Is that what you're looking for, mas o menos? Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: Biased random?

2007-08-27 Thread J. Cliff Dyer
I don't know if this is pythonic or not, but try something like this: from math import log from random import randint def: skewedrandom(n): int(log(randrange(1,n), 2)) Play with your log to get the range you want Cheers, Cliff Grant Edwards wrote: On 2007-08-27, Jun-geun Park &l

Re: strings (dollar.cents) into floats

2007-08-30 Thread J. Cliff Dyer
Gary Herron wrote: luca bertini wrote: Hi, i have strings which look like money values (ie 34.45) is there a way to convert them into float variables? everytime i try I get this error: "numb = float(my_line) ValueError: empty string for float()" " here's the code import sys

Re: why should I learn python

2007-09-06 Thread J. Cliff Dyer
Torsten Bronger wrote: Hallöchen! Tom Brown writes: [...] Python has been by far the easiest to develop in. Some people might say it is not "real programming" because it is so easy. I can't believe this. Have you really heard such a statement? Tschö, Torsten. The catch-phrase s

Re: Modul (%) in python not like in C?

2007-09-09 Thread J. Cliff Dyer
Turbo C will always yield a number such that if x = m%n -x = -m%n. That is, since 111 % 10 = 1, -111 % 10 = -1. The two values will always differ by n (as used above). I'm sure there are mathematicians on the list who can give you a more technical, precise explanation of the rea

Re: Python syntax wart

2007-09-10 Thread J. Cliff Dyer
J. Cliff Dyer wrote: Lawrence D'Oliveiro wrote: In message <[EMAIL PROTECTED]>, Bjoern Schliessmann wrote: What's wrong with this: for Link in GetEachRecord( Then you're no longer showing the syntax structure in two dimensions. If somebody handed me a

Re: question on python syntax

2007-09-10 Thread J. Cliff Dyer
to be perfectly clear, you don't type the $. It's already there for you, in some form; your prompt may not be a $. Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: printing list containing unicode string

2007-09-10 Thread J. Cliff Dyer
handle this limitation. UTF-16 is based on a two-byte unit, but is variable width, like UTF-8, which makes it flexible enough to handle any code point, but harder to process, and a bear to seek through to a certain point. (I'm politely ignoring your ill-reasoned attacks on non-Microsoft OSes). Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: Enum class with ToString functionality

2007-09-10 Thread J. Cliff Dyer
\ "Try to become not a man of success, but try rather to >> become a | `\ man of value." >> -Albert Einstein | _o__) >> | Ben Finney > > What is the difference between this version and the 1.0 version? > Uh... The 1.0 version is vaporware? Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: Modul (%) in python not like in C?

2007-09-11 Thread J. Cliff Dyer
time before the 1999 standard. C89, commonly called ANSI C, is still very commonly used in compilers, and K&R C goes back to 1972. Is truncation toward 0 the standard for K&R C as well? Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: Enum class with ToString functionality

2007-09-11 Thread J. Cliff Dyer
> elif testResult == TestOutcomes.FAILED : > testResultAsString = "Failed" > else: > testResultAsString = "Aborted" > return testResultAsString > > Regards, > > Zara > > This code cannot output "Unknown," because you use an else: at the end of your if-chain to represent a specific (non-catch-all) case. s/else:/elif testResult == TestOutcomes.ABORTED:/ Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: function to do dynamic import?

2007-09-11 Thread J. Cliff Dyer
bambam wrote: > import works in the main section of the module, but does > not work as I hoped when run inside a function. > > That is, the modules import correctly, but are not visible to > the enclosing (global) scope. > > Questions: > (1) Where can I read an explanation of this? > (2) Is there a

Re: Python statements not forcing whitespace is messy?

2007-09-15 Thread J. Cliff Dyer
l of that mess, is the run-ins involving " characters. The rest are at least clear at a glance what belongs where. Also, would you require the following? my_function (swallow='European') Because that is just an awful use of whitespace. Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: string questions

2007-09-15 Thread J. Cliff Dyer
Marc 'BlackJack' Rintsch wrote: > But please don't use the functions in `string` that are also available as > methods on strings. Those functions are deprecated. > > Meaning (for newbie clarification): instead of string.upper(s2), just do s2.upper(). For more detail, see the docs. -- http

Re: generate list of partially accumulated values

2007-09-16 Thread J. Cliff Dyer
> > to me it sounds a bit different from the original request, but... > > That's because it's the next problem on his homework assignment. See also the thread entitled: "generating list of sub lists. Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

SVG to raster conversion.

2007-09-16 Thread J. Cliff Dyer
Does anybody know a good solution (preferably in python) for rasterizing SVG or other vector graphics. I'm thinking something like vector_image = SVGFile(path_to_image) raster_image = vector_image.rasterize(format, (width, height), dpi) raster_image.write(out_file) Thanks for any pointers you mi

Re: SVG to raster conversion.

2007-09-16 Thread J. Cliff Dyer
Stefan Behnel wrote: > J. Cliff Dyer wrote: > >> Does anybody know a good solution (preferably in python) for rasterizing >> SVG or other vector graphics. >> >> I'm thinking something like >> >> vector_image = SVGFile(path_to_image) >>

Re: Python "with"

2007-09-16 Thread J. Cliff Dyer
allow you to import all names from a module, unprefixed but it leads you into the same ugliness and namespace clobbering that you get with Perl, so I'm not going to tell you how to do it. I think the 'import long.name as short' syntax will help your wrists the most while still retaining the clarity of explicit module referencing. And you won't have the extraneous assignment (tmp = long.name) cluttering up your code. Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: Try this

2007-09-16 Thread J. Cliff Dyer
ormat Unicode Document If Microsoft offers to create documents in three different formats with the same extension, it damn well better make some effort to figure out which one it's trying to open when it reopens those same documents. Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: Python "with"

2007-09-17 Thread J. Cliff Dyer
the most is not a fancy trick for getting rid of the namespace, but getting over your aversion to them. That will make you a better programmer, in the long run. Debugging will be easier, people will enjoy working with your code more. Clarity is beautiful. Objectively so. Not just some lame "in the eye of the beholder" kind of beautiful. Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: adodb with mysql - connection string syntax for filepath

2007-09-17 Thread J. Cliff Dyer
_init_ > business that many sites mention. (This *is* something even a newbie > needs to learn, right?) > Try this chapter from Diving into Python: http://www.diveintopython.org/object_oriented_framework/defining_classes.html > Thank you! > > M.R.S. Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: UTF-8 characters in doctest

2007-09-20 Thread J. Cliff Dyer
f strings. If you want to pass that result on to a for loop, and only loop once on the string (instead of looping on each letter of the string), you might want to wrap it in a tuple or a list before passing it to the loop. Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: UTF-8 characters in doctest

2007-09-20 Thread J. Cliff Dyer
J. Cliff Dyer wrote: > John J. Lee wrote: > >> Peter Otten <[EMAIL PROTECTED]> writes: >> [...] >> >> >>> def f(s): >>> return (s,) >>> >>> >> Forgive me if this is a stupid question, but: W

Re: RE Help

2007-09-21 Thread J. Cliff Dyer
on whether it is greedy or non greedy, will either spit out ['STARTdefSTARTghiEND'] or ['STARTghiEND']. Correction, it will spit out the first one, whether greedy or not. The difference comes with two END tags in a row. Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-21 Thread J. Cliff Dyer
been rejected because of this very problem, so unless you have a clean solution, I think your proposal falls into the category of "would be nice, but not in Python." Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about quoting style.

2007-10-01 Thread J. Cliff Dyer
re also raw. Also use them when talking about escape sequences like \n" r"""Same for "\n" Here""" u'Unicode strings are useful for multilingual or non-latin text. I\u2019d recommend reading more about Python's unicode handling. It can be a bit tricky for newcomers.' Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: Top Programming Languages of 2013

2007-10-07 Thread J. Cliff Dyer
Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: pytz has so many timezones!

2007-10-08 Thread J. Cliff Dyer
statement that DST and half-hour offsets "only matter[] if you're setting your clock." None of those are meaningful with 25 generic time zones, which was what I was trying to understand. Under what normal circumstances (outside of the US military creating an approximation for their own internal usage) could 25 tzs be a useful abstraction? Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: pytz has so many timezones!

2007-10-09 Thread J. Cliff Dyer
n the world who see their minority Uighur brethren as oppressed by the authorities of Beijing. On the other hand, you might annoy the authorities in Beijing. Which is just to say that choice of time zone is not just a geographic issue. There are political, diplomatic issues to weigh as well.

Re: why doesn't have this list a "reply-to" ?

2007-10-16 Thread J. Cliff Dyer
quot; which has the ugly side effect that the poster of the message I'm responding to gets 2 copies, unless I remember to delete one of them. Same method with mutt, though I'm sure I could customize mutt to pay better attention to the headers, if I used it enough to bother. Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: Failure to connect in SimpleXMLRPCServer/xmlrpclib

2007-10-22 Thread J. Cliff Dyer
fine, but the server rejected the client's request. So now the issue is why is the request being rejected? Did you check your firewall to see if it is blocking access to port 8000 on the ethernet adapter? Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: if..else stmt

2007-10-22 Thread J. Cliff Dyer
Your else statement is incorrectly indented. The interpreter treats it as part of the for-loop construct inside the if statement rather than as part of the if statement itself. See the recent thread about for-else constructs for more details. If your problem is not obvious yet, make sure you are

Re: if..else stmt

2007-10-22 Thread J. Cliff Dyer
bigden007 wrote: > Hi, > I have a if..else statement in my script. The statements all execute > fine, but the problem is , even if the IF part of the statement is > true, the else part executes as well. The verion of pythin i use 2.5 > Any help is appreciatiated. > > Regards > > Big Den. > > You

Re: Going past the float size limits?

2007-10-26 Thread J. Cliff Dyer
000L Do you really need more than 700 places of precision? Once your numbers are that large, surely you can use integer math, right? (FYI 5 * (10 ** 1) works just as well. Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: Proposal: Decimal literals in Python.

2007-10-26 Thread J. Cliff Dyer
ity of meaning for brevity. > > Matt My only problem with Decimal("12.34") is the quotation marks. It makes it look like a string type. Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: Proposal: Decimal literals in Python.

2007-10-26 Thread J. Cliff Dyer
, Aug 31 2007, 16:54:27) [MSC v.1310 32 bit (Intel)] on win32 >>> type(0b1) >>> type(0o1) >>> type(0x1) >>> assert 0b1 is 0x1 >>> >>> type(0d1) >>> assert 0b1 is 0d1 Traceback (most recent call last): File "", line 1, in assert 0b1 is 0d1 AssertionError It would also be unkind to people with dyslexia. Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: Alarming message when running Python code

2007-10-27 Thread J. Cliff Dyer
mputer. If a basic cleaning doesn't take care of the problem, take your computer to a professional. Cheers, Cliff P.S. This is not a python-specific issue. -- http://mail.python.org/mailman/listinfo/python-list

Re: while within while

2007-10-27 Thread J. Cliff Dyer
if ai == "2": > ai = "paper" > if ai == "3": > ai = "scissors" > > since it says I choose > > Lo and behold: it *is* ignoring that block. Why? Or in other words what set of conditions have to be true in order to reach that block? Which one of them is false? (Hint: Check your while loops, and your initialization variables.) Also, Why not use decision = ('rock', 'paper', 'scissors')? Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: Proposal: Decimal literals in Python.

2007-10-27 Thread J. Cliff Dyer
at the octal argument as a string, rather than an int: os.chmod(filename, "777") If somebody had a good *general* use for octal, it might be worth having in the language. Otherwise, it seems like an unused which is only kept around because it used to get played with. (back in the days of six bit hardware?) Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: tuples within tuples

2007-10-27 Thread J. Cliff Dyer
uceXML(node[2]) > > N.B. Beware of stack limitations. > > Also, as noted elsewhere in the string, your C is actually a list of Cs. So replace my else statement with return [(child[0], reduceXML(child[2])) for child in node] I think that'll do what you need. Howe

Re: Pari Python

2007-10-28 Thread J. Cliff Dyer
import it from __future__ yourself. Don't break all current code by recompiling python to do it. You'll alienate most of your potential user base, and develop a reputation for not playing well with others. Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: attaching someconfusing results in webbrowser.open on gnulinux

2007-11-01 Thread J. Cliff Dyer
ead, try calling: webbrowser.open("documents/tut.html") If that works, also try webbrowser.open("/home/krishna/documents/tut.html") I suspect both of those will work. There must be some other syntax for opening URLs directly. Or maybe it interoperates with urllib. Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: A Python 3000 Question

2007-11-01 Thread J. Cliff Dyer
Steven D'Aprano wrote: > On Wed, 31 Oct 2007 22:48:12 -0700, Carl Banks wrote: > > >>> I hope you're not serious that $# would make a good operator. >>> >> If you happen to know where I borrowed it from, it would be pretty >> evident that I wasn't being serious. >> > > Ooh, now I'm c

Re: serving html from a python script in IE

2007-11-01 Thread J. Cliff Dyer
; If you take out the space between text/html and ; it works just fine. (In other words, there is no mime-type "text/html ") Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: ValueError: invalid \x escape

2007-11-01 Thread J. Cliff Dyer
double quotes within the string, of course), so python sees a \P, a \L a \s, and a \m in your string. There are two ways to solve this: 1) Use a raw string: r'D:\Python24\Lib' 2) Escape your backslashes: 'D:\\Python24\\Lib' I assume the real value of 'mycode' has a

Re: regular expressions

2007-11-07 Thread J. Cliff Dyer
You don't need regular expressions to do that. Look into the methods that >> strings have. Look at slicing. Look at len. Keep your code readable for >> future generations. >> >> Py>>> help(str) >> Py>>> dir(str) >> Py>>> hel

Re: How about adding rational fraction to Python?

2008-02-25 Thread J. Cliff Dyer
the camp that believes that 3/4 does indeed yield the integer 0, but should be spelled 3//4 when that is the intention. Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: How about adding rational fraction to Python?

2008-02-26 Thread J. Cliff Dyer
On Tue, 2008-02-26 at 04:29 -0800, Lie wrote: > > J Cliff Dyer: > > I'm in the camp that believes that 3/4 does indeed yield the integer > 0, > > but should be spelled 3//4 when that is the intention. > > That's creepy for people that are new to programming

Re: How about adding rational fraction to Python?

2008-02-26 Thread J. Cliff Dyer
On Tue, 2008-02-26 at 10:08 -0500, D'Arcy J.M. Cain wrote: > On Tue, 26 Feb 2008 06:45:45 -0800 (PST) > Carl Banks <[EMAIL PROTECTED]> wrote: > > On Feb 26, 9:29 am, "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> wrote: > > > If 3/4 ever returned 0.75 in any language I would drop that language. > > > > Ha

Re: How about adding rational fraction to Python?

2008-02-26 Thread J. Cliff Dyer
On Tue, 2008-02-26 at 13:51 -0500, D'Arcy J.M. Cain wrote: > On Tue, 26 Feb 2008 13:39:38 -0500 > "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote: > > >>> a = 2 * 2 > > >>> b = 20 * 20 > > >>> type(a) > > &

Re: How about adding rational fraction to Python?

2008-02-28 Thread J. Cliff Dyer
On Thu, 2008-02-28 at 11:22 -0500, D'Arcy J.M. Cain wrote: > Not obvious to you. You are using subjective perception as if it was > a > law of nature. If "obvious" was the criteria then I would argue that > the only proper result of integer division is (int, int). Give me the > result and the re

Skull Socks (was Re: Convention vs. fascism)

2009-01-16 Thread J. Cliff Dyer
On Fri, 2009-01-16 at 08:57 +, Steven D'Aprano wrote: > On Fri, 16 Jan 2009 10:03:28 +0200, Hendrik van Rooyen wrote: > > > Oh come on you lot - you are carrying on as if Diez were wearing his > > skull socks again - do me a favour and give him a break! > And... skull socks? Cool. Where can

Re: The First Law Of comp.lang.python Dynamics

2009-01-23 Thread J. Cliff Dyer
I dub it Schluehr's law. On Thu, 2009-01-22 at 21:39 -0800, Kay Schluehr wrote: > Whatever sufficiently sophisticated topic was the initially discussed > it ends all up in a request for removing reference counting and the > GIL. > > -- > http://mail.python.org/mailman/listinfo/python-list > --

Re: Newby: how to transform text into lines of text

2009-01-26 Thread J. Cliff Dyer
On Sun, 2009-01-25 at 18:23 -0800, John Machin wrote: > On Jan 26, 1:03 pm, "Gabriel Genellina" > wrote: > > En Sun, 25 Jan 2009 23:30:33 -0200, Tim Chase > > escribió: > > > > > > > > > Unfortunately, a raw rstrip() eats other whitespace that may be > > > important. I frequently get tab-de

Re: I'm a python addict !

2009-01-26 Thread J. Cliff Dyer
know that. > > So yay for Python, but don't get in the habit of criticising that which > you do not know. There are legitimate reasons to criticize things even when they are powerful. Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: I'm a python addict !

2009-01-26 Thread J. Cliff Dyer
l and fun. But scary. Any thoughts on how you would use that in a way that wouldn't unleash sulphurous code smells? Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   >