Re: How to prevent tests from running against production?

2013-03-03 Thread Ross Ridge
on environment would seem to be the obvious solution. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Speeding up Python's exit

2013-03-03 Thread Ross Ridge
ython normally doesn't change this. Only the Python process's own internal buffers are flushed, the OS doesn't change its handling of its buffers. If you want written data to be fully committed before exiting you need to use other OS services that guarantee this.

Re: String manipulation in python..NEED HELP!!!!

2012-12-11 Thread Ross Ridge
newest versions I have handy). CPython optimized this case of string concatenation into O(n) back in Python 2.4. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: from future import pass_function

2012-07-25 Thread Ross Ridge
Ross Ridge wrote: > No, they're very much alike. That's why all your arguments for print > as function also apply just as well to pass a function. Your arguments > had very little to do what what print actually did. Chris Angelico wrote: >Except that print / print() is

Re: from future import pass_function

2012-07-25 Thread Ross Ridge
Steven D'Aprano wrote: >What's the point of this? Ross Ridge wrote: > Remember everything you've said about why its a good thing the that > print statement is now a function? That. Steven D'Aprano wrote: >I can't believe I actually have to point this ou

Re: from future import pass_function

2012-07-25 Thread Ross Ridge
er everything you've said about why its a good thing the that print statement is now a function? That. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db //

Re: the meaning of rユ.......ï¾

2012-07-23 Thread Ross Ridge
II characters outside of strings and comments even when the language (supposedly) allows it. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http:/

Re: the meaning of rユ.......��

2012-07-23 Thread Ross Ridge
as the ASR-33. If any one actually wanted another programming language like this it would've come into existance 20 or 30 years ago not 20 or 30 years from now. Python actually choose to go the other direction and choose to use keywords as operators instead of symbols in a number of in

Re: How to safely maintain a status file

2012-07-12 Thread Ross Ridge
antics, an assumption that Laszlo Nagy did not make. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: when "normal" parallel computations in CPython will be implemented at last?

2012-07-01 Thread Ross Ridge
Thomas Jollans wrote: >There is, of course, Stackless Python. >http://stackless.com/ Stackless Python doesn't really address the original poster's problem as the GIL still effectively limits Python code running in one thread at a time. Ro

Re: Smallest/cheapest possible Python platform?

2012-05-26 Thread Ross Ridge
erally available or increase your budget. You should also consider whether any of these devices have Python bindings to interface with their GPIO pins. If not you'll probably have to end up writing some C code anyways. Ross Ridge -- l/ // Ro

Re: Newbie questions on import & cmd line run

2012-05-17 Thread Ross Ridge
ell what interpreter to use to execute the program if >you run it directly. They're actually interpreted by the kernel so that they'll work when run from any program. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] r

Re: "convert" string to bytes without changing data (encoding)

2012-03-29 Thread Ross Ridge
Ross Ridge wrote: > Just because I refuse to drink the > "it's impossible to represent strings as a series of bytes" kool-aid Terry Reedy wrote: >I do not believe *anyone* has made that claim. Is this meant to be a >wild exaggeration? As wild as Evan's? Sorry

Re: "convert" string to bytes without changing data (encoding)

2012-03-29 Thread Ross Ridge
e advocated writing any style of code in thread. Just because I refuse to drink the "it's impossible to represent strings as a series of bytes" kool-aid does't mean that I'm a heretic that must oppose against everything you believe in.

Re: Re: Re: "convert" string to bytes without changing data (encoding)

2012-03-28 Thread Ross Ridge
bility), but in a high >level language, you cannot assume any correlation between objects and >bytes. Any code that depends on implementation details is risky. How does that in anyway justify Evan Driscoll maliciously lying about code he's never seen?

Re: Re: Re: "convert" string to bytes without changing data (encoding)

2012-03-28 Thread Ross Ridge
s another thing entirely. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Re: "convert" string to bytes without changing data (encoding)

2012-03-28 Thread Ross Ridge
esn't mean I can never say anything about it. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: "convert" string to bytes without changing data (encoding)

2012-03-28 Thread Ross Ridge
at that the internal representation of strings wasn't what he expected to be. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: "convert" string to bytes without changing data (encoding)

2012-03-28 Thread Ross Ridge
d like Chris Angelico that there's isn't a direct mapping from the his Python 3 implementation's internal respresentation of strings to bytes in order to label what he's asking for as being "silly". Ross Ridge --

Re: "convert" string to bytes without changing data (encoding)

2012-03-28 Thread Ross Ridge
Ross Ridge wr= > Of course it is. =A0Conceptually you're not supposed to think of it that > way, but a string is stored in memory as a series of bytes. Chris Angelico wrote: >Note that distinction. I said that a string "is not" a series of >bytes; you say that it

Re: "convert" string to bytes without changing data (encoding)

2012-03-28 Thread Ross Ridge
x27;s your problem here than then that's what you should be addressing, not pretending that it's fundamentally impossible. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo

Re: XSLT to Python script conversion?

2012-02-17 Thread Ross Ridge
Ross Ridge writes: > The XSLT language is one of the worst misuses of XML, which puts it way > beyond bad. Stefan Behnel wrote: >Clearly a matter of opinion. No. There's no excuse for using XML as the syntax of a language like XLST. Ross

Re: XSLT to Python script conversion?

2012-02-17 Thread Ross Ridge
Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: can I distribute Microsoft.VC90.CRT files?

2011-07-19 Thread Ross Ridge
hope that helps. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Free software versus software idea patents (was: Python benefits over Cobra)

2011-04-07 Thread Ross Ridge
sn't meet the legal definition of a contract, it can be revoked unilateraly (but not retroactively) by the copyright holder at any time for any reason. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http:/

Re: logging module -- better timestamp accuracy on Windows

2011-02-15 Thread Ross Ridge
debug("processing time %.0fms", (timer() - start) * 1000) Saves you from having to do the math in your head when you look at the logs. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http:

Re: Does pickled objects work fine between different OS?

2010-05-26 Thread Ross Ridge
a.pkl" just fine on Windows XP? That will work just fine. The only thing that may be a problem is that if you choose to use the newer pickle format, it won't work with versions of Python before 2.3. Ross Ridge -- l/ // Ross Ridge -- The

Re: MemoryError, can I use more?

2010-02-14 Thread Ross Ridge
use more than 4GB of RAM through indirect means like multiple processes, the disk cache or video card RAM. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-26 Thread Ross Ridge
lities in a lot of third party applications that couldn't be easily fixed by deploying a patched DLL with Windows Update. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-21 Thread Ross Ridge
tributable Package. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-17 Thread Ross Ridge
elf doesn't need it, and py2exe shouldn't either, but wxPython, or more precisely wxWidgets, almost certainly does. So in your case you'll probably need to redistribute both DLLs. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-17 Thread Ross Ridge
oft Visual C++ or Python 2.6.4. Otherwise, you don't have the legal right to redistribute Microsoft's code. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~r

Re: How to tell if you're running on windows?

2009-12-04 Thread Ross Ridge
In your case you can use the "sys.platform" variable to distinguish between Cygwin and a real Unix-type OS. You may end up needing to treat Cygwin as a special case. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub

Re: Are there any modules for IRC, that work with Python 3.1?

2009-10-16 Thread Ross Ridge
TerryP wrote: >Having recently been put into search for a new IRC client, and >everything I've thrown in the cauldron having become a >disappointment... Have you tried the IRC client script for Vim? Ross Ridge -- l/ // Ross Ridge --

Re: best vi / emacs python features

2009-10-08 Thread Ross Ridge
th the rest of my life as soon >as possible. Given the choice of using a space cadets editor like >emacs or something primitive one like ed, I would choose *ed* just to >speed things up and save on wrist strain. But in actual practice you use a space cadets editor like Vim.

Re: Unpack Expects the Wrong Number of Bytes

2009-07-18 Thread Ross Ridge
an prefix depending on the byte order used in the file you're trying to unpack. You can also use the "=" native byte-order flag if endianness of the file format changes according to the machine your Python program runs on. If you use any of these flags, no extra padding will be ins

Re: reply to OT diversion (was: What is the best method to match a pattern in set of lines

2009-06-24 Thread Ross Ridge
rotected from spammers with an X-Google-Only option. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Meta question: disappearing posts (was Re: calculating a self.value, self.randomnum = normalvariate(x, y))

2009-06-24 Thread Ross Ridge
Ross Ridge wrote: >I'm not sure what MIME would have to do with it, but Piet van Oostrum's >problem is almost certainly as result of the python.org mail to news >gateway mangling the References header. The missing postings he's looking >for don't actually exist.

Re: Meta question: disappearing posts (was Re: calculating a self.value, self.randomnum = normalvariate(x, y))

2009-06-22 Thread Ross Ridge
p the thread one more posting and you'll find the message that was being replied to. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Status of Python threading support (GIL removal)?

2009-06-19 Thread Ross Ridge
certainly seen multi-core speedup >with threaded software, so show us your benchmarks! By definition an I/O bound thread isn't CPU bound so won't benefit from improved CPU resources. Ross Ridge -- l/ // Ross Ridge -- The Great HTM

Re: matplotlib installation

2009-06-15 Thread Ross Ridge
nything wrong with the Microsoft runtime. A library that mixes both objects and import records is perfectly legitimate. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/

Re: To unicode or not to unicode

2009-02-21 Thread Ross Ridge
Ross Ridge (Sat, 21 Feb 2009 18:06:35 -0500) > I understand what Unicode and MIME are for and why they exist. Neither > their merits nor your insults change the fact that the only current > standard governing the content of Usenet posts doesn't require their > use. Thorsten Kampe

Re: To unicode or not to unicode

2009-02-21 Thread Ross Ridge
Ross Ridge (Sat, 21 Feb 2009 17:07:35 -0500) > The link demonstrates that Google Groups doesn't assume ASCII like > Python does. Since popular newsreaders like Google Groups and Outlook > Express can display the message correctly without the MIME headers, > but your obscure one

Re: To unicode or not to unicode

2009-02-21 Thread Ross Ridge
Ross Ridge (Sat, 21 Feb 2009 14:52:09 -0500) > Except in practice unlike Python, many newsreaders don't assume ASCII. Thorsten Kampe wrote: >They assume ASCII - unless you declare your charset (the exception being >Outlook Express and a few Windows newsreaders). Everything else

Re: To unicode or not to unicode

2009-02-21 Thread Ross Ridge
/828fefd7040238bc I could just as easily argue that assuming ISO 8859-1 is the defacto standard, and that its your newsreader that's broken. The reality however is that RFC 1036 is the only standard for Usenet messages, defacto or otherwise, and so there's nothing wrong with an

Re: To unicode or not to unicode

2009-02-21 Thread Ross Ridge
e header in a Usenet message, so there's nothing wrong with the original poster's newsreader. In any case what the original poster really should do is come up with a better name for his program Ross Ridge -- l/ // Ross Ridge -- The Grea

Re: unable to print Unicode characters in Python 3

2009-01-28 Thread Ross Ridge
. There are many characters in Unicode that can't be reasonably mappped to a single fixed-width "console" glyph. There are also characters in Unicode that should be represented as single-width gylphs in Western contexts, but as double-width glyphs in Far-Eastern contexts

Re: progress: compiling python2.5 under msys (specifically but not exclusively under wine) with msvcr80

2009-01-25 Thread Ross Ridge
oft Visual C++ runtime library, and isn't "free software" in the FSF sense. It's free as in beer, but then so is the Microsoft compiler. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http:/

Re: what's the point of rpython?

2009-01-22 Thread Ross Ridge
Ross Ridge writes: > The same cache coherency mechanism that prevents ordinary "unlocked" > instructions from simulanteously modifying the same cache line on > two different processors also provides the guarantee with "locked" > instructions. There's no addit

Re: what's the point of rpython?

2009-01-21 Thread Ross Ridge
hanism that prevents ordinary "unlocked" instructions from simulanteously modifying the same cache line on two different processors also provides the guarantee with "locked" instructions. There's no additional hardware locks involved, and no additional communication required.

Re: what's the point of rpython?

2009-01-20 Thread Ross Ridge
Intel systems it's normally handled completely within the cache. >The LOCK prefix adds about 100 cycles to the instruction. That's unavoidable. It's still faster than spin lock, which would also have to use syncronizing instructions. Ross Ridge -

Re: what's the point of rpython?

2009-01-20 Thread Ross Ridge
gh I think it would also be possible on MIPS CPUs. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Debugging a Python Program that Hangs

2008-12-03 Thread Ross Ridge
int_exc() raise Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: HELP!...Google SketchUp needs a Python API

2008-11-28 Thread Ross Ridge
for any other post in this thread. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Exception difference 2.4 ==> 2.5

2008-11-19 Thread Ross Ridge
r error. The client thread then throws a ProtocolError, which is uncaught. So exceptions are working fine in your test case, the problem is that xmlrpclib.dumps() can't marshall xmlrpclib.Fault objects in 2.5. Ross Ridge -- l/ // Ross Ridge -- The Gr

Re: Exception difference 2.4 ==> 2.5

2008-11-18 Thread Ross Ridge
at all. Python 2.5 changed the exception hierarchy a bit. The Exception class is no longer at the root and now inheirits from BaseException. If the exception being thrown was KeyboardInterrupt or SystemExit then it won't be caught by your code. Ros

Re: What's the perfect (OS independent) way of storing filepaths ?

2008-10-21 Thread Ross Ridge
Ross Ridge wrote: > As opposed to the file system being the single point failure? Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: >The file system is involved regardless. But leaving out an additional >layer of failure on top of it does make things more robust, yes. No,

Re: What was that, what was it?

2008-10-21 Thread Ross Ridge
o go fast, but good for a lot of every day tasks. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: What's the perfect (OS independent) way of storing filepaths ?

2008-10-21 Thread Ross Ridge
Ross Ridge wrote: > However, the normal place to store settings on Windows is in the registry. Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > Which becomes a single point of failure for the whole system. As opposed to the file system being the sin

Re: indentation

2008-10-20 Thread Ross Ridge
lly can be *the* standard if it's only being followed it when it's convenient. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.or

Re: indentation

2008-10-20 Thread Ross Ridge
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > I can't remember having seen any other "standard" so far. > Ross Ridge a écrit : > I've seen various indentation styles used in examples on this newsgroup. Bruno Desthuilliers <[EMAIL PROTECTED]> wro

Re: What's the perfect (OS independent) way of storing filepaths ?

2008-10-20 Thread Ross Ridge
ata directory (if not). However, the normal place to store settings on Windows is in the registry. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: indentation

2008-10-20 Thread Ross Ridge
else uses 2 space indentation. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: python3 - the hardest hello world ever ?

2008-10-17 Thread Ross Ridge
en to be supported in 2.5 or 2.6? The fact that I can't change the encoding attribute of sys.stdout/stderr/stdin has caused problems for me in the past. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://

Re: Efficient Bit addressing in Python.

2008-10-11 Thread Ross Ridge
Ross Ridge wrote: >I don't think you can do anything faster with standard modules, although >it might not be efficient if you're only working with a single byte. Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: >Thanks I was not aware of binascii module this looks powerful

Re: Efficient Bit addressing in Python.

2008-10-10 Thread Ross Ridge
"""Convert an array containing a sequence of bits to a string.""" remainder = len(a) % 8 if remainder != 0: a.fromlist([0] * (8 - remainder)) s = a.tostring() s = binascii.unhexlify(s.translate(_tr_rev_2))

Re: How to emit UTF-8 from console mode?

2008-10-01 Thread Ross Ridge
quot;for i in range(0x410, 0x430): print unichr(i).encode('utf-8')" > x C:\> type x [a bunch of Cyrillic letters] Hmm... "more x" doesn't work, while "copy x con" works but gives an error. Looks like Windows XP support UTF-8 console output is a bit half-

Re: Python style: exceptions vs. sys.exit()

2008-09-26 Thread Ross Ridge
e or whatever-like objects etc, it's the caller's responsability > to handle the exceptions that may be raised by what *he* passes to the > library... Ross Ridge a écrit : > Ug... that's another documentation pet-peeve of mine. Libraries that > say they take file-

Re: Python style: exceptions vs. sys.exit()

2008-09-25 Thread Ross Ridge
on't say exactly how file-like it needs. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Python style: exceptions vs. sys.exit()

2008-09-25 Thread Ross Ridge
Ross Ridge wrote: > Plenty of people were quick to say that the exception should be passed > through to the caller. No one said this behaviour should be documented. > There may be little practical difference bewteen calling sys.exit() > after printing an error and progating an excepti

Re: Python style: exceptions vs. sys.exit()

2008-09-24 Thread Ross Ridge
Grant Edwards <[EMAIL PROTECTED]> wrote: > Same here. It's like an automotive engine controls designer > asking if a failed O2 sensor should turn on the check engine > light or blow up the car. Ross Ridge <[EMAIL PROTECTED]> wrote: > No, it's more like askin

Re: Python style: exceptions vs. sys.exit()

2008-09-24 Thread Ross Ridge
e. It's like an automotive engine controls designer >asking if a failed O2 sensor should turn on the check engine >light or blow up the car. Ross Ridge <[EMAIL PROTECTED]> wrote: > No, it's more like asking if the failed sensor should turn on > a strange and mysterious li

Re: Python style: exceptions vs. sys.exit()

2008-09-24 Thread Ross Ridge
iver doesn't immediately stop and check the engine. The owners manual would only vaguely hint at the fact that this could happen. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca

Re: universal unicode font for reportlab

2008-09-10 Thread Ross Ridge
>as though it just embeds the entire font. Yah, PDF files normally only contain an embedded subset of the fonts used. It might possible to use Ghostscript's ps2pdf command (which can take a PDF file as input) to strip out the unused glyphs from the embedded fonts.

Re: universal unicode font for reportlab

2008-09-09 Thread Ross Ridge
mes with Microsoft Office. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: universal unicode font for reportlab

2008-09-08 Thread Ross Ridge
Office) will automatically substitute characters from other fonts, if necessary. >I don't know whether it was already installed or installed by OO or >how one would get to it to extract it. It's a standard Windows font. Ross Ridge -- l/

Re: Change PC to Win or Windows

2008-07-31 Thread Ross Ridge
erPC processors that ran Windows NT. I even remember seeing one that had ISA slots. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Loading just in time

2008-07-11 Thread Ross Ridge
ax from calc_tax import calc_tax return calc_tax(*arg, **name) I suspect though that the cost of importing a lot of little modules won't be as bad as you might think. Ross Ridge -- l/ // Ross Ridge -- The Great HTM

Re: Bug in floating-point addition: is anyone else seeing this?

2008-05-22 Thread Ross Ridge
e-precision arithmetic. That way your answers are only wrong when you use long double or float. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: py3k concerns. An example

2008-04-21 Thread Ross Ridge
language features >alone do not help a language and its community of users to grow >and proliferate. I think most would agree that it is the cornucopia >of libraries that really make Python an environment for developing >production applications. Definately.

Re: 2's complement conversion. Is this right?

2008-04-19 Thread Ross Ridge
Ross Ridge <[EMAIL PROTECTED]> wrote: > It's the same as the previous version except that it "precompiles" > the struct.unpack() format string. =A0It works similar to the way Python > handles regular expressions. George Sakkis <[EMAIL PROTECTED]> wrote: &

Re: 2's complement conversion. Is this right?

2008-04-18 Thread Ross Ridge
Ross Ridge <[EMAIL PROTECTED]> said: > If you have Python 2.5, here's a faster version: > > from struct import * > unpack_i32be = Struct(">l").unpack > > def from3Bytes_ross2(s): > return unpack_i32be(s + "\0&qu

Re: 2's complement conversion. Is this right?

2008-04-18 Thread Ross Ridge
ck def from3Bytes_ross2(s): return unpack_i32be(s + "\0")[0] >> 8 Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: 2's complement conversion. Is this right?

2008-04-18 Thread Ross Ridge
st case is correct, "Value -= 0x100". The value 0xFFF should be -1 and 0xFFF - 0x100 == -1. An alternative way of doing this: Value = unpack(">l", Buffer[s:s+3] + "\0")[0] >> 8 Ross Ridge -- l/

Re: Windows - window status (Running vs Not Responding)

2008-04-11 Thread Ross Ridge
of 5 seconds. Syntax BOOL IsHungAppWindow( HWND hWnd ); ... You can use EnumWindows() to enumerate the all the top level windows. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU

Re: Anomaly in time.clock()

2008-03-19 Thread Ross Ridge
value in the range of -3.5 to -4.5. However, a race condition occuring between the two evaluations of "curTime - self.timeStamp" is the only way your example program could print a negative value. Ross Ridge -- l/ // Ross Ridge -- The Great H

Re: Fast 2D Raster Rendering with GUI

2008-03-18 Thread Ross Ridge
than OpenGL here. The overhead of calling some sort of putpixel() function over and over will domininate everything else. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~

Re: BitVector

2008-03-10 Thread Ross Ridge
a.fromlist([0] * (8 - remainder)) s = a.tostring() s = binascii.unhexlify(s.translate(_tr_rev_2)) s = binascii.unhexlify(s.translate(_tr_rev_4)) return binascii.unhexlify(s.translate(_tr_rev_16)) I've

Re: How about adding rational fraction to Python?

2008-02-28 Thread Ross Ridge
Ross Ridge wrote: > You're just going to have to accept that there that there is no > concensus on this issue and there never was. Steven D'Aprano <[EMAIL PROTECTED]> wrote: >But that's not true. The consensus, across the majority of people (both >programmers a

Re: How about adding rational fraction to Python?

2008-02-28 Thread Ross Ridge
our that no one wants. No one is going to win this argument by using words like "natural" or "obvious". You're just going to have to accept that there that there is no concensus on this issue and there never was. In the end only one person's opinion of what was natura

Re: How about adding rational fraction to Python?

2008-02-27 Thread Ross Ridge
ave a problem with the behviour of the slash (/) operator changing. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: time.time() strangeness

2008-02-27 Thread Ross Ridge
ng FPU precision could have an effect on low end configurations. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: time.time() strangeness

2008-02-26 Thread Ross Ridge
a 32-bit single-precision floating-point value. This means that number returned by time.time() only has 24 bits of precision, which for current time values, only gives you an accuracy of a hundred seconds or so. Ross Ridge -- l/ // Ross Ridge

Re: How about adding rational fraction to Python?

2008-02-26 Thread Ross Ridge
Ross Ridge <[EMAIL PROTECTED]> writes: > D'Arcy said nothing about natural numbers, and bringing them up adds > nothing to this discussion. Paul Rubin <http://[EMAIL PROTECTED]> wrote: > The numbers D'Arcy is proposing to operate on that way are natural > numb

Re: How about adding rational fraction to Python?

2008-02-26 Thread Ross Ridge
TECTED]> wrote: > The natural result of doing arithmetic with natural numbers is more > natural numbers. D'Arcy said nothing about natural numbers, and bringing them up adds nothing to this discussion. Ross Ridge -- l/ // Ro

Re: How about adding rational fraction to Python?

2008-02-26 Thread Ross Ridge
eason keeping me from switching to Python 3 for a long time. If the slash (/) operator had always been defined as floating point division then I would've gotten used to it. Now however, there's no compelling reason for me to try to adjust to this new behaviour.

Re: Python Memory Manager

2008-02-20 Thread Ross Ridge
cache, rather than the RAM. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Win32 python: odd behavior when run via ssh

2008-02-01 Thread Ross Ridge
hon and it doesn't think stdin/stdout is attached to a console. If you're using the Cygwin version of Python than it's probably bug. If you're using the offficial Win32 port of Python than you probably want to use the Cygwin version because Win32 version doesn't support re

Re: Why os.path.isabs("/") on Windows returns True?

2008-02-01 Thread Ross Ridge
ing directory, so it's strange the isabs() behaves differently. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Using a dict as if it were a module namespace

2008-01-27 Thread Ross Ridge
angles >the global namespace of the calling code, not the code being tested. It wouldn't work because the timeit module's "globals" are different from the __main__ module's globals. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] [EMAIL PROTECTED] -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >