Re: Unpacking Binary Data - not using struct module

2004-12-16 Thread Scott David Daniels
Geoffrey wrote: I am working on a file conversion project that reads data from a one file format, reformats in and writes in out to another. The data is records of informations - names address, account number,statistics. The numeric values in the original file are stored in what appears to be a "p

Re: libxml2/xpath

2004-12-16 Thread maxk
> # confDocument is a libxml2 document, from parseFile() etc > xp = confDocument.xpathNewContext() > xp.xpathRegisterNs("xhtml", "http://www.w3.org/1999/xhtml";) > dirElement = xp.xpathEval( "/xhtml:html" ) > Stupid question, but can the namespace somehow be changed to null to mak

datetime

2004-12-16 Thread Chris
Okay, I searched www.python.org for a date handler and found datetime. http://www.python.org/dev/doc/devel/lib/module-datetime.html However, whenever I try to import datetime, I get a No module named datetime error. What am I missing? Chris -- http://mail.python.org/mailman/listinfo/python-li

Re: How do I convert characters into integers?

2004-12-16 Thread tenax . raccoon
There's another option that I haven't seen yet as well, where you use the translation method for strings. # Build a list where each entry is a character whose value is 3 higher than its index. charList = [ chr((x+3) % 256) for x in range(256) ] transform = ''.join(charList) # Change the list to

create lowercase strings in lists - was: (No subject)

2004-12-16 Thread Diez B. Roggisch
Helpful subjects help commands = [c.lower() for c in commands] -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Redirecting stdin, stdout, and stderr to a window

2004-12-16 Thread Michael McGarry
Hi, How do I redirect stdin, stdout and stderr to a window? I am using Qt for GUI. Thanks, Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Python compiler method

2004-12-16 Thread Terry Reedy
"Lady_Valerie" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > hello guys! i just want to ask favor, coz i want to know how python > compiler method could be done? im really clueless of this programming > language hope anyone coule help me with this topic... im just focusing > only

RE: Why are tuples immutable?

2004-12-16 Thread Marc Boeren
> def __cmp__ (self, other): > # I wish there was a less verbose way to do this! > if self.block < other.block: > return -1 > if self.block > other.block: > return 1 > if self.lot < other.lot: > return -1 > if self.lot >

Re: I DECLARE THIS THREAD FINISHED

2004-12-16 Thread Steve Holden
Paul McGuire wrote: "Jive" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Everyone keep moving. There is nothing to see here. Move along. You wish! If only ending a thread were that easy - we wouldn't be hearing about "Why is Python slower than Java?" anymore! But I agree with Mart

Re: ".>>>" is a good idea! (OT, was: Re: do you master list comprehensions?)

2004-12-16 Thread Steve Holden
Nick Coghlan wrote: Roel Schroeven wrote: Stefan Behnel wrote: This is the first time I see that and I totally like the idea of writing ".>>>" instead of ">>>" at the beginning of a line. Thank you Dr. Dobb! It's unfortunate for c.l.py that Python uses ">>>" as the default prompt as it messes up

Re: Python IDE

2004-12-16 Thread fuzzylollipop
no it was a sideways remark at all the software socialists that thing EVERYTHING should be free, never said anything about Eclipse, just the people that insist ALL software should be free. -- http://mail.python.org/mailman/listinfo/python-list

Re: why not arrays?

2004-12-16 Thread Terry Reedy
"Nick Coghlan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > For more complex (i.e. multi-dimensional) arrays - the general answer is > "get numpy". I'm not aware of the actual reasons why numpy is not > included in the standard library, but some possible reasons would be: > > -

Re: create lowercase strings in lists - was: (No subject)

2004-12-16 Thread Mark Devine
Sorry for not putting a subject in the last e-mail. The function lower suited my case exactly. Here however is my main problem: Given that my new list is : [class-map match-all cmap1', 'match ip any', 'class-map match-any cmap2', 'match any', 'policy-map policy1', 'class cmap1', 'policy-map polic

Re: ".>>>" is a good idea! (OT, was: Re: do you master list comprehensions?)

2004-12-16 Thread Keith Dart
Steve Holden wrote: Nick Coghlan wrote: Roel Schroeven wrote: Stefan Behnel wrote: This is the first time I see that and I totally like the idea of writing ".>>>" instead of ">>>" at the beginning of a line. Thank you Dr. Dobb! It's unfortunate for c.l.py that Python uses ">>>" as the default pr

Accessing DB2 with Python

2004-12-16 Thread Shawn Milo
Is anyone doing this? I would like to access a DB2 database (IBM's database) with Python. I checked "Python in a Nutshell," and it refers to ftp://people.linuxkorea.co.kr/pub/db2, but I am unable to connect to that site, although it could be a firewall issue, as I am at work. Is there any common

Re: Python mascot proposal

2004-12-16 Thread Luis M. Gonzalez
Stephan, Since you're one of the directors of the Python Software Foundation, could you let them know about this discussion in order to get their approval? If they agree, maybe you can tell us where and how to held the contest. Just one thought: I think that it would be good to not determine a de

BASIC vs Python

2004-12-16 Thread abisofile
hi I'm new to programming.I've try a little BASIC so I want ask since Python is also interpreted lang if it's similar to BASIC. -- http://mail.python.org/mailman/listinfo/python-list

Re: BASIC vs Python

2004-12-16 Thread It's me
"abisofile" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > hi > > I'm new to programming.I've try a little BASIC so I want ask since > Python is also interpreted lang if it's similar to BASIC. > > > Is a Ferrari similar to a horse-wagon? Yes, they both have 4 wheels. :=) --

Re: module file length limitations on windows?

2004-12-16 Thread Steve Holden
Lonnie Princehouse wrote: I've run into some eccentric behavior... It appears that one of my modules is being cut off at exactly 2^14 characters when I try to import it. Has anyone else encountered this? I can't find any mention of such a bug, and stranger yet, other modules that exceed 16384 ch

Re: ".>>>" is a good idea! (OT, was: Re: do you master list comprehensions?)

2004-12-16 Thread Roel Schroeven
Steve Holden wrote: Nick Coghlan wrote: $ python Python 2.4 (#1, Dec 4 2004, 20:10:33) [GCC 3.3.3 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.ps1 = ".>>> "; sys.ps2 = " " .>>> print """\ It isn't that hard"""

Re: NO REALLY

2004-12-16 Thread Roel Schroeven
Scott David Daniels wrote: This, of course, means that DJIJSTRA (there, one of the J's is right) SUX!!! And so do DONALD NUTH, BRIAN ERNIGHAN, ROB PIE, EN THOMPSON, JOHN CARMAC, FRED BROOS, NIKAUS WIRTH, ONRAD ZUSE AND STEVE WOZNIA!! ;) -- "Codito ergo sum" Roel Schroeven -- http://mail.pytho

Re: lies about OOP

2004-12-16 Thread Terry Reedy
"Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > provide class methods. Though for the life of me I don't *really* know > why I find it acceptable in Python to have to write module.func(args) > when I dislike having to write class.meth(args) in Java. I have the same

Re: Adding paths to sys.path permanently, and another problem...

2004-12-16 Thread Jean Brouwers
Maybe, set environment variable PYTHONPATH. More details at /Jean Brouwers In article <[EMAIL PROTECTED]>, Lenard Lindstrom <[EMAIL PROTECTED]> wrote: > Amir Dekel <[EMAIL PROTECTED]> writes: > > > Hi everyone, > > > > I have two problems

Re: Best book on Python?

2004-12-16 Thread Jean Brouwers
The text of David Mertz' book is available on line at /jean Brouwers In article <[EMAIL PROTECTED]>, Mirko Zeibig <[EMAIL PROTECTED]> wrote: > Maurice LING said the following on 12/12/2004 11:13 PM: > >>Google for Dive Into Python. Its a free online publication, see i

Why no list heritable type?

2004-12-16 Thread James Stroud
The thread "why not arrays" got me thinking. I would really like to inherit from a list so that I can add methods based on its contents, say if I filled it with a type of object and wanted to iterate over all objects. I have built a wrapper around a list like this for general use: class list_of

Re: Why no list heritable type?

2004-12-16 Thread Steve Holden
James Stroud wrote: The thread "why not arrays" got me thinking. I would really like to inherit from a list so that I can add methods based on its contents, say if I filled it with a type of object and wanted to iterate over all objects. I have built a wrapper around a list like this for general

Re: Adding paths to sys.path permanently, and another problem...

2004-12-16 Thread Jeff Shannon
Lenard Lindstrom wrote: Amir Dekel <[EMAIL PROTECTED]> writes: Hi everyone, I have two problems: 1. How can I keep my changes in sys.path after closing the interpreter? Saving sys.path changes between interpreter runs would be more involved. On Windows Python loads the initial module search

Re: ".>>>" is a good idea! (OT, was: Re: do you master list comprehensions?)

2004-12-16 Thread Steven Bethard
Kent Johnson wrote: You can do the same thing using a PYTHONSTARTUP file - see http://docs.python.org/tut/node4.html#SECTION00424 You can change the prompts with import sys sys.ps1 = ' >>> ' sys.ps2 = ' ... ' Very cool. I didn't know about this. Does anyone know how to make it

Re: newbie: Datetime module for Python 2.2.x

2004-12-16 Thread Jarek Zgoda
Eric Azarcon wrote: I'm fairly new to Python, and was wondering if someone might be able to help. I'm doing something that requires the datetime module released in 2.3. Unfortunately, the target machines are running 2.2.x and there is no easy way that I know of to install 2.3/2.4 (RHEL ES). I've do

Re: Why no list heritable type?

2004-12-16 Thread James Stroud
Steve Holden wrote: > I think the thing you are really missing is the fact that list and the > other built-in types can be used as the basis for inheritance: I've never seen this done in any manual that I can remember. Its so useful, that I thought I would have run into it before as an example

Re: Why no list heritable type?

2004-12-16 Thread Jeremy Bowers
On Thu, 16 Dec 2004 12:53:32 -0800, James Stroud wrote: > Then it can be heritable and I can add or override methods. Why aren't > built in lists and dictionaries real heritable types that can save this > kind of patchwork? Is there a pythonic reason I am missing here? Along with others pointing o

Socket being garbage collected too early

2004-12-16 Thread Scott Robinson
I have been having trouble with the garbage collector and sockets. Unfortunately, google keeps telling me that the problem is the garbage collector ignoring dead (closed?) sockets instead of removing live ones. My problem is x.sock=socket.socket(socket.AF_INET,socket.SOCK_STREAM)

Re: Why no list heritable type?

2004-12-16 Thread Mike Meyer
"Robert Brewer" <[EMAIL PROTECTED]> writes: >> Why aren't built >> in lists and dictionaries real heritable types that can save >> this kind of patchwork? > > They are since Python 2.2 (IIRC): And before Python 2.2 there was the UserList class in the standard library. Which is still there in 2.

Re: Redirecting stdin, stdout, and stderr to a window

2004-12-16 Thread Michael Fuhr
Michael McGarry <[EMAIL PROTECTED]> writes: > How do I redirect stdin, stdout and stderr to a window? I am using Qt > for GUI. I don't know what specific mechanisms Qt provides, but the general solution is to write a class that implements I/O methods like read, readline, and write, and assign in

Re: Socket being garbage collected too early

2004-12-16 Thread Steve Holden
Scott Robinson wrote: I have been having trouble with the garbage collector and sockets. Unfortunately, google keeps telling me that the problem is the garbage collector ignoring dead (closed?) sockets instead of removing live ones. My problem is x.sock=socket.socket(socket.AF_INET,socket.SOCK

Re: Html or Pdf to Rtf (Linux) with Python

2004-12-16 Thread Mike Meyer
Axel Straschil <[EMAIL PROTECTED]> writes: > Hello! > >> That's easy. Load the HTML in MS Word, and save it as RTF. Script it >> via COM using the python win32all (I think that's what it's now >> called) package. > As I wrote in my posting and the subject: linux ;-) > I could try to do this with o

Re: create lowercase strings in lists - was: (No subject)

2004-12-16 Thread Michael Spencer
Steve Holden wrote: Mark Devine wrote: Actually what I want is element 'class-map match-all cmap1' from list 1 to match 'class-map cmap1 (match-all)' or 'class-map cmap1 mark match-all done' in list 2 but not to match 'class-map cmap1'. Each element in both lists have multiple words in them. If a

Re: BASIC vs Python

2004-12-16 Thread Mike Meyer
"Thomas Bartkus" <[EMAIL PROTECTED]> writes: > The "interpreted" nature of the existing Python language has little to do > with how it compares to other languages. Most languages, including BASIC, > are available in either flavor - interpreted or compiled. And either way, > it's still the same la

Re: Socket being garbage collected too early

2004-12-16 Thread Mike Meyer
Scott Robinson <[EMAIL PROTECTED]> writes: > I have been having trouble with the garbage collector and sockets. > Unfortunately, google keeps telling me that the problem is the garbage > collector ignoring dead (closed?) sockets instead of removing live > ones. My problem is > > > x.sock=so

Re: Python IDE

2004-12-16 Thread Dan Perl
"Mike Meyer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > A: What's the most obnoxious thing on Usenet? > Q: topposting. What is "Jeopardy", Alex? You got your Q&A mixed up. So what, just because I wrote at the top of the posting you couldn't see my warning sign for the sarca

Re: Accessing DB2 with Python

2004-12-16 Thread Grumman
Jarek Zgoda wrote: Be aware, that it's a module for "normal" DB2, not a DB2/400. To access DB2/400 you have to use ClientAccess ODBC (from Windows or *nix platform) driver or iSeries port of Python (from AS/400). And just to be complete, under windows, using win32all, you can also use the OLE

<    1   2   3