Re: Converting TIFF files to PDF and/or JPEG

2006-01-17 Thread Fredrik Lundh
"sophie_newbie" <[EMAIL PROTECTED]> wrote: > As part of a college project I'm trying to write a script to convert > TIFF images downloaded from the US patent office site, www.uspto.gov. > > The tiff images are encoded using CCITT Group 4 compression and appear > to throw an error when i try to sav

Re: Arithmetic sequences in Python

2006-01-17 Thread Gregory Petrosyan
Hey guys, this proposal has already been rejected (it is the PEP 204). -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting TIFF files to PDF and/or JPEG

2006-01-17 Thread Paul Rubin
"sophie_newbie" <[EMAIL PROTECTED]> writes: > It looks like this odd compression format is not supported, or am i > wrong? > > I know its a long shot but would anyone have a different solution? I don't know about doing it directly in Python but there's a Linux command line utility called tiff2ps

Re: magical expanding hash

2006-01-17 Thread braver
Can assigning to hash without intermediate levels, possibly adding to a numeric leaf or adding an element to a leaf array, be python code? h['a']['b']['c'] += 42 If it can, I'd like to have a class which supports it. Is keeping a list at the leaf of a hash python code? h['a']['b']['c'].push(7)

Re: magical expanding hash

2006-01-17 Thread Paul Rubin
"braver" <[EMAIL PROTECTED]> writes: > Can assigning to hash without intermediate levels, possibly adding to a > numeric leaf or adding an element to a leaf array, be python code? > > h['a']['b']['c'] += 42 > > If it can, I'd like to have a class which supports it. Yes, it's simple enough to wri

Re: Testing complex new syntax

2006-01-17 Thread Carl Friedrich Bolz
[EMAIL PROTECTED] wrote: > Carl Friedrich Bolz wrote: > >>I cannot really say much about how easy it would be to just write a >>preprocessor. However, I think what you are trying to do could be done >>reasonably easy with the PyPy project: >> >>http://codespeak.net/pypy >> >>PyPy is an implementat

Re: On Numbers

2006-01-17 Thread Tom Anderson
On Mon, 16 Jan 2006, Erik Max Francis wrote: > Steven D'Aprano wrote: > >> The square root of 1 is +1 (the negative root being explicitly >> rejected). Pure mathematicians, who may be expected to care whether the >> root is the integer 1 or the real number 1, are unlikely to write >> 1**0.5, pr

Re: magical expanding hash

2006-01-17 Thread braver
Well, I know some python, but since there are powerful and magical features in it, I just wonder whether there're some which address this issue better than others. -- http://mail.python.org/mailman/listinfo/python-list

Re: Web application design question (long)

2006-01-17 Thread Tom Anderson
On Tue, 16 Jan 2006, Fried Egg wrote: > I am interested if anyone can shed any light on a web application > problem, I'm not going to help you with that, but i am going to mention the Dada Engine: http://dev.null.org/dadaengine/ And its most famous incarnation, the Postmodernism Generator: h

Re: Shrinky-dink Python (also, non-Unicode Python build is broken)

2006-01-17 Thread Larry Hastings
> Are you willing to monitor and fix new Py_USING_UNICODE issues or > are you proposing just to produce a patch now and then expect > contributors to maintain this feature? Neither, I suppose, or perhaps both. I am proposing to produce a patch now which fixes the non-Unicode build under Windows.

Re: OT: excellent book on information theory

2006-01-17 Thread Terry Hancock
On Tue, 17 Jan 2006 13:28:15 + Steve Holden <[EMAIL PROTECTED]> wrote: > Grant Edwards wrote: > > Very interesting. And rather sad that editors think the > > average Amermican reader too dim-witted to figure out > > (in context, even) that a "car park" is a "parking lot" > > and a "dustbin" is

Ordering numbers

2006-01-17 Thread yawgmoth7
I have a dictonary here: seq = {8:0x13AC9741, 10:0x27592E8, 4:0x4EB25D, 5:0x9D64B, 7:0x13AC9, 1:0x2759, 11:0x4EB, 3:0x9D, 9:0x13, 2:0x2, 0:0x0, 6:0x0} Python always prints them in order, from least to greatest. But I wanna have it show them in hte order that I put in. Thanks for all your help gu

Re: Arithmetic sequences in Python

2006-01-17 Thread Tom Anderson
On Tue, 16 Jan 2006, it was written: > Tom Anderson <[EMAIL PROTECTED]> writes: > >> The natural way to implement this would be to make .. a normal >> operator, rather than magic, and add a __range__ special method to >> handle it. "a .. b" would translate to "a.__range__(b)". I note that >> Ro

Re: Ordering numbers

2006-01-17 Thread Fredrik Lundh
"yawgmoth7" wrote: > I have a dictonary here: > > seq = {8:0x13AC9741, 10:0x27592E8, 4:0x4EB25D, 5:0x9D64B, 7:0x13AC9, > 1:0x2759, 11:0x4EB, 3:0x9D, 9:0x13, 2:0x2, 0:0x0, 6:0x0} > > Python always prints them in order, from least to greatest. nope. Python prints them in ... in an arbitrary o

Re: Arithmetic sequences in Python

2006-01-17 Thread Tom Anderson
On Tue, 17 Jan 2006, Antoon Pardon wrote: > Op 2006-01-16, Alex Martelli schreef <[EMAIL PROTECTED]>: >> Paul Rubin wrote: >> >>> Steven D'Aprano <[EMAIL PROTECTED]> writes: For finite sequences, your proposal adds nothing new to existing solutions like range a

Re: Running DOS App on win32 via python over ssh

2006-01-17 Thread Peter Hansen
James Stroud wrote: > The program in question, in case anyone doesn't understand this problem, > is lem: > > http://spitswww.uvt.nl/web/fsw/mto/lem/lemdos.zip Well, LEM.EXE calls RTM.EXE and RTM.exe contains signs of not being a pure DOS program. It contains references to USER.EXE and KERNEL.E

Re: Arithmetic sequences in Python

2006-01-17 Thread Xavier Morel
Paul Rubin wrote: > I don't think this is a valid objection. Python is already full of > syntactic sugar like indentation-based block structure, infix > operators, statements with keyword-dependent syntax, etc. It's that > very sugar that attracts programmers to Python away from comparatively > s

Re: Converting TIFF files to PDF and/or JPEG

2006-01-17 Thread [EMAIL PROTECTED]
The Tiff library and utilities combined with Ghostscript make this very easy. http://www.remotesensing.org/libtiff/ http://www.cs.wisc.edu/~ghost/ With the above two packages installed, you can do something like this in Python: def tiff2pdf(width, length, files): path, filename = os.pat

Re: magical expanding hash

2006-01-17 Thread James Stroud
braver wrote: > Well, I know some python, but since there are powerful and magical > features in it, I just wonder whether there're some which address this > issue better than others. > In python, += is short, of course, for a = a + 1 But if we haven't already assigned a, how does the interpret

Re: Arithmetic sequences in Python

2006-01-17 Thread Steven Bethard
Gregory Petrosyan wrote: > Hey guys, this proposal has already been rejected (it is the PEP 204). No, this is a subtly different proposal. Antoon is proposing *slice* literals, not *range* literals. Note that "confusion between ranges and slice syntax" was one of the reasons for rejection of `

Re: magical expanding hash

2006-01-17 Thread Steven Bethard
Steve Holden wrote: > Steven Bethard wrote: >> Agreed. I really hope that Python 3.0 applies Raymond Hettinger's >> suggestion "Improved default value logic for Dictionaries" from >> http://wiki.python.org/moin/Python3%2e0Suggestions >> >> This would allow you to make the setdefault() call o

Re: Preventing class methods from being defined

2006-01-17 Thread David Hirschfield
I realize now that it would probably be best to define the problem I'm having according to the constraints imposed by other requirements, and not by describing the basic functionality. That way, since there are so many possible ways to get something like what I want, there will probably be only

Dr. Dobb's Python-URL! - weekly Python news and links (Jan 18)

2006-01-17 Thread Magnus Lycka
QOTW: "*what* the value is is defined by the operations that the object supports (via its type). *how* the value is represented inside the object is completely irrelevant; a Python implementation may use electric charges in small capacitors, piles of rocks, diapers,or an endless supply of small

Re: magical expanding hash

2006-01-17 Thread braver
Thanks, James! This is really helpful. : It would take a lot of coding to make that << work right. Better is the pythonic : : m[key] = [value] : : Its really only one more keystroke than : : m[key] << value But it's only for the first element, right? I'd have to say meh[key1]...[keyN].append(el

Re: How to get Windows system information?

2006-01-17 Thread dpickles
nevermind, found it thanks all! -- http://mail.python.org/mailman/listinfo/python-list

Another method of lazy, cached evaluation.

2006-01-17 Thread simonwittber
Recently, I needed to provide a number of game sprite classes with references to assorted images. I needed a class to: - allow instances to specify which image files they need. - ensure that a name should always refer to the same image. - only load the image if it is actually used. Af

check to see if value can be an integer instead of string

2006-01-17 Thread nephish
Hello there, i need a way to check to see if a certain value can be an integer. I have looked at is int(), but what is comming out is a string that may be an integer. i mean, it will be formatted as a string, but i need to know if it is possible to be expressed as an integer. like this var = some

Re: OT: excellent book on information theory

2006-01-17 Thread Paul Rubin
Terry Hancock <[EMAIL PROTECTED]> writes: > > > Very interesting. And rather sad that editors think the > > > average Amermican reader too dim-witted to figure out > > > (in context, even) that a "car park" is a "parking lot" > > > and a "dustbin" is a "trash can." > > > ... > The real reason is t

Re: magical expanding hash

2006-01-17 Thread Jean-Paul Calderone
On Tue, 17 Jan 2006 16:47:15 -0800, James Stroud <[EMAIL PROTECTED]> wrote: >braver wrote: >> Well, I know some python, but since there are powerful and magical >> features in it, I just wonder whether there're some which address this >> issue better than others. >> > >In python, += is short, of co

Re: check to see if value can be an integer instead of string

2006-01-17 Thread Claudio Grondi
[EMAIL PROTECTED] wrote: > Hello there, > i need a way to check to see if a certain value can be an integer. I > have looked at is int(), but what is comming out is a string that may > be an integer. i mean, it will be formatted as a string, but i need to > know if it is possible to be expressed as

Re: magical expanding hash

2006-01-17 Thread James Stroud
braver wrote: > Thanks, James! This is really helpful. > > : It would take a lot of coding to make that << work right. Better is > the pythonic > : > : m[key] = [value] > : > : Its really only one more keystroke than > : > : m[key] << value > > But it's only for the first element, right? I'd ha

Re: check to see if value can be an integer instead of string

2006-01-17 Thread nephish
thanks for the reply, but wont python fail out if you try to make an integer out of what cant be an integer? like this : var = int(abc) wont this crash ? -- http://mail.python.org/mailman/listinfo/python-list

search multiple dictionaries efficiently?

2006-01-17 Thread Livin
I'm a noobie so please be easy on me. I have searched a ton and did not find anything I could understand. I'm using py2.3 I've been using Try/Except but this gets long with multiple dictionaries. I found some code on web pages and such but cannot get them to work. Any help is appreciated as I

Re: check to see if value can be an integer instead of string

2006-01-17 Thread Brian Cole
Python uses "Exceptions" to catch these "Exceptional" situations:http://docs.python.org/tut/node10.html -Brian Cole On 17 Jan 2006 18:51:44 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > thanks for the reply, but wont python fail out if you try to make an > integer out of what cant be an i

Re: check to see if value can be an integer instead of string

2006-01-17 Thread gry
[EMAIL PROTECTED] wrote: > Hello there, > i need a way to check to see if a certain value can be an integer. I > have looked at is int(), but what is comming out is a string that may > be an integer. i mean, it will be formatted as a string, but i need to > know if it is possible to be expressed as

The Python cross? Was New Python.org website

2006-01-17 Thread Obaid R.
Bugs wrote: > I thought I read here that a new website design was in the works for > python.org in time for the new year? Is that still true and of so, > anyone know what is it's status? > Thanks! I googled around and found no background on how the new Python logo came to be selected. Does any o

Re: check to see if value can be an integer instead of string

2006-01-17 Thread nephish
this looks like the solution i am looking for. thanks for the education by the way. i have a couple of other try / except clauses. Never thought of pulling it off like that. thanks very much, really simple. -- http://mail.python.org/mailman/listinfo/python-list

Re: HP open source printer drivers are in Python

2006-01-17 Thread Andy Leszczynski
Andy Leszczynski wrote: > I have a specific question, anybody is familiar? Just wanted to report, that problem is solved :-). But seriously, sorry for enigmatic question. I have had a very weird problem with HPLIP 0.97. Wanted to check out if there is someone familiar with the design of HPLIP

Re: search multiple dictionaries efficiently?

2006-01-17 Thread Paul McGuire
"Livin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm a noobie so please be easy on me. I have searched a ton and did not find > anything I could understand. > > I'm using py2.3 > > I've been using Try/Except but this gets long with multiple dictionaries. > > I found some code o

Re: search multiple dictionaries efficiently?

2006-01-17 Thread George Sakkis
Livin wrote: > I'm a noobie so please be easy on me. I have searched a ton and did not find > anything I could understand. > > I'm using py2.3 > > I've been using Try/Except but this gets long with multiple dictionaries. > > I found some code on web pages and such but cannot get them to work. Any

Python 2.4, Win XP Pro and Tix

2006-01-17 Thread Mondal
Hi, After searching the messages on this group I concluded that perhaps no one has posted the problem and the solution I mention below. When I used Tix for the first time I recieved the following error message. >>> import Tix >>> r=Tix.Tk() Traceback (most recent call last): File "", line 1, i

Re: Newbie ? -- SGML metadata extraction

2006-01-17 Thread ProvoWallis
Thanks very much for your help. It's greatly appreciated. It look a couple of tries to see what was happening but I've figured it out. Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: excellent book on information theory

2006-01-17 Thread Alex Martelli
Terry Hancock <[EMAIL PROTECTED]> wrote: ... > due to the Evil Conspiracy of region-coding, I couldn't > watch the British DVD even if I were to import it (Well, > yeah I could, but it would be painful, and probably illegal, I have a region-free DVD player here in CA -- considering that I broug

Funny! More offers to select a search engine!

2006-01-17 Thread zizi2002198
www.goodugle.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Arithmetic sequences in Python

2006-01-17 Thread Alex Martelli
Tom Anderson <[EMAIL PROTECTED]> wrote: ... > Sounds good. More generally, i'd be more than happy to get rid of list > comprehensions, letting people use list(genexp) instead. That would > obviously be a Py3k thing, though. I fully agree, but the BDFL has already (tentatively, I hope) Pronounc

Re: ConfigParser: writes a list but reads a string?

2006-01-17 Thread Terry Carroll
On Tue, 17 Jan 2006 09:11:24 -0600, Larry Bates <[EMAIL PROTECTED]> wrote: >To read lists from .INI files I use following: > >listvalues=INI.get(section, option).split(',') > >where INI is an instance of ConfigParser > >There is the problem of if list items contain commas. Thanks; that's basical

Re: XML Writer in wxPython

2006-01-17 Thread Tim Roberts
"Marco Meoni" <[EMAIL PROTECTED]> wrote: > >Could you post an example please? Not really; it depends on what it is you're writing. def PrintAddress( last, first, address, city, state, zip ): print " " print "%s" % last print "%s" % first print "%s" % address prin

Re: Is 'everything' a refrence or isn't it?

2006-01-17 Thread Max
Terry Hancock wrote: > On Sat, 07 Jan 2006 01:29:46 -0500 > Mike Meyer <[EMAIL PROTECTED]> wrote: > >>From what I can tell, Liskov proposed *three* different >>names for >>passing references to objects: call-by-sharing, >>call-by-object, and call-by-object-reference. > > > "Call by object refere

10060, 'Operation timed out'

2006-01-17 Thread Sumit Acharya
I am using following script to connect to the server and i try the connection for 1000 times. Some times it succeeds for all the 1000 times,but some times it fails with error:- 10060, 'Operation timed out'. When it fails with the abover error, it seems timed out time is 20 seconds. Is there a way I

Re: search multiple dictionaries efficiently?

2006-01-17 Thread gene tani
Livin wrote: > I'm a noobie so please be easy on me. I have searched a ton and did not find > anything I could understand. > > I'm using py2.3 > > I've been using Try/Except but this gets long with multiple dictionaries. > > I found some code on web pages and such but cannot get them to work. Any

Re: Problem with FTPLib and incomplete files on some downloads

2006-01-17 Thread Martin Franklin
Peter A.Schott wrote: > I download a lot of 4-6 KB files and regularly run into issues with files that > don't get downloaded all the way or otherwise get corrupt. > > I do something like: > > RemoteList = nlstdir() > for filename in RemoteList: > LocalFile = open(filename, "wb") > LocalFile.

Re: OT: excellent book on information theory

2006-01-17 Thread Steve Holden
Alex Martelli wrote: > Terry Hancock <[EMAIL PROTECTED]> wrote: >... > >>due to the Evil Conspiracy of region-coding, I couldn't >>watch the British DVD even if I were to import it (Well, >>yeah I could, but it would be painful, and probably illegal, > > > I have a region-free DVD player her

<    1   2