Re: lies about OOP

2004-12-15 Thread Fredrik Lundh
Mike Meyer wrote: >> If OOP is so beneficial for large projects, why are the Linux kernel, >> the interpreters for Perl and Python, and most compilers I know written >> in C rather than C++? > > Because C++ combines the worst features of C and OO programming. It > also makes some defaults go the w

Re: thread/queue bug

2004-12-15 Thread Antoon Pardon
Op 2004-12-14, Steve Holden schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: > >> Op 2004-12-13, Tim Peters schreef <[EMAIL PROTECTED]>: >> >>>[Antoon Pardon] >>> I don't see why starting a thread as a side effect of importing is bad thread practice. Sure python doesn't cater for it, bu

Re: RegEx: find all occurances of a single character in a string

2004-12-15 Thread Franz Steinhaeusler
On Tue, 14 Dec 2004 14:05:38 +0100, Franz Steinhaeusler <[EMAIL PROTECTED]> wrote: >given a string: > >st="abcdatraataza" >^ ^ ^ ^ (these should be found) >I want to get the positions of all single 'a' characters. >(Without another 'a' neighbour) >[...] Thank you again, Pádraig and Stev

Re: Help need with converting Hex string to IEEE format float

2004-12-15 Thread TZOTZIOY
On Tue, 14 Dec 2004 16:57:02 +0100, rumours say that "Fredrik Lundh" <[EMAIL PROTECTED]> might have written: >how about: > ># convert to byte string >import struct >s = "".join([chr(int(c, 16)) for c in x]) >v = struct.unpack("!f", s) I think that the third line in the snippet abo

Re: lies about OOP

2004-12-15 Thread Gerrit
binL9yPfo4Fv5.bin Description: application/pgp-encrypted msg.asc Description: Binary data -- http://mail.python.org/mailman/listinfo/python-list

Re: while 1 vs while True

2004-12-15 Thread Nick Coghlan
Paul Rubin wrote: Nick Coghlan <[EMAIL PROTECTED]> writes: Until this code: .>>> import pdb .>>> pdb.True = 0 .>>> pdb.x = "Darn writeable module dictionaries" .>>> from pdb import True .>>> True 0 .>>> from pdb import x .>>> x 'Darn writeable module dictionaries' If Python really does behave that

Re: logging in omniORB for python

2004-12-15 Thread f
Birgit Rahm wrote: Hello newsgroup, Hello Birgit, I haven't found any way to do logging in a standard way. The solution i've implemented is to decorate each method you want to log the call, using the logging module (included in python since 2.3) For example : import logging def loggedmethod(metho

Re: Why are tuples immutable?

2004-12-15 Thread Antoon Pardon
Op 2004-12-13, Fredrik Lundh schreef <[EMAIL PROTECTED]>: > "jfj" wrote: > >> Why can't we __setitem__ for tuples? > > http://www.python.org/doc/faq/general.html#why-are-there-separate-tuple-and-list-data-types > >> The way I see it is that if we enable __setitem__ for tuples there >> doesn't seem

Re: RegEx: find all occurances of a single character in a string

2004-12-15 Thread Fredrik Lundh
<[EMAIL PROTECTED]> wrote: > r=re.compile("a+") > [m.start() for m in r.finditer(s) if len(m.group()) == 1] > < Mine runs 100K iterations of 'abcdatraataza','a' in 1.4s > whereas Fredrik's does the same in 1.9s sure, but how long did it take you to come up with a working RE? and how many casual

Re: Why are tuples immutable?

2004-12-15 Thread Fuzzyman
Wasn't part of the point, that function call returns ought to be immuntable. Otherwise you can accidentally end up modifying objects that are referenced in other places ? Obviously tuples aren't the *whole* answer... but they help. Regards, Fuzzy http://www.voidspace.org.uk/atlantibots/pythonuti

ANN: Python Test Environment

2004-12-15 Thread Fuzzyman
Well sort of... Highly experimental - I'm interested in ways of improving this. http://www.voidspace.org.uk/atlantibots/pythonutils.html#testenv I've created a script that will build a 'test environment'. Windoze(tm) only as it uses py2exe. It scans your Python\Lib folder (configurable) and

Thanks (Re: gather information from various files efficiently)

2004-12-15 Thread Klaus Neuner
Hello, (Sorry for beginning a new thread. Google does not allow me to reply to my own posting. And I cannot use a newsreader at the moment.) Thanks to all who participated in the thread. I tried the try- and the if-solution. The setdefault-solution didn't work in my program. With the try-soluti

import wx

2004-12-15 Thread km
Hi all, Has anyone tried building wxPython-2.5.3 with python2.4 ? after building and setting paths stuff, i have trouble importing wx - the error says : "ImportError : No module named _core_" can someone shed light on this ? regards, KM -- http://mail.python.org/mailman/listinfo/python-list

Re: lies about OOP

2004-12-15 Thread Martijn Faassen
Paul McGuire wrote: "Martijn Faassen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Paul McGuire wrote: [snip] I would characterize the 80's as the transitional decade from structured programming (which really started to hit its stride when Djikstra published "Use of GOTO Considered H

Re: Why are tuples immutable?

2004-12-15 Thread Fredrik Lundh
Antoon Pardon wrote: >> how would you implement a dictionary where the keys could change, without >> any performance penalty compared to the current implementation? > > The performace gained by using tuples as keys in dictionaries is > entirely illusional. > > Sure the fact that you use a tuple wh

Re: do you master list comprehensions?

2004-12-15 Thread Nick Coghlan
Will Stuyvesant wrote: Here is a question about list comprehensions [lc]. The question is dumb because I can do without [lc]; but I am posing the question because I am curious. This: data = [['foo','bar','baz'],['my','your'],['holy','grail']] result = [] for d in data: ... for w in d: ...

Re: jython and concatenation of strings

2004-12-15 Thread Nick Coghlan
Jan Gregor wrote: StringBuffer class from java was right solution - yours looses encoding, and in jython I was unable to get it back - in python it worked fine. If you mean that Jython returned a string, when the inputs were unicode, then that can probably be fixed with: result = u''.join(string_

ANN: Python Test Environment

2004-12-15 Thread Michael Foord
Well sort of... Highly experimental - I'm interested in ways of improving this. http://www.voidspace.org.uk/atlantibots/pythonutils.html#testenv I've created a script that will build a 'test environment'. Windoze(tm) only as it uses py2exe. It scans your Python\Lib folder (configurable) and bui

Step by step: Compiling extensions with MS Visual C++ Toolkit 2003 - msvccompiler-patch.txt (0/1)

2004-12-15 Thread Martin Bless
The good news: Along with Python-2.4 comes really good news to Windows users. Yes, you now CAN build extension modules yourself using the SAME C++ compiler and linker Python is built with itself. Everything you need is available at no costs (except download hassle and installation time). Once your

Re: Why are tuples immutable?

2004-12-15 Thread Antoon Pardon
Op 2004-12-15, Fredrik Lundh schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: > >>> how would you implement a dictionary where the keys could change, without >>> any performance penalty compared to the current implementation? >> >> The performace gained by using tuples as keys in dictionaries is

KeyError

2004-12-15 Thread rootshell
Hello. Maybe someone will help me with this KeyError: Traceback (most recent call last): File "C:\Python\tabla.py", line 929, in -toplevel- tablesDirectory = tablesDirectoryPrefix + os.environ['REMOTE_ADDR'] File "C:\Python23\lib\os.py", line 417, in __getitem__

Re: subprocess vs. proctools

2004-12-15 Thread Nick Craig-Wood
Keith Dart <[EMAIL PROTECTED]> wrote: > Nick Craig-Wood wrote: > > This sounds rather like the new subprocess module... > > > import subprocess > rc = subprocess.call(["ls", "-l"]) > > > > total 381896 > > -rw-r--r--1 ncw ncw 1542 Oct 12 17:55 1 > > [snip] > > -rw-r--r--1 nc

Re: KeyError

2004-12-15 Thread Frans Englich
On Wednesday 15 December 2004 13:33, [EMAIL PROTECTED] wrote: > Hello. > Maybe someone will help me with this KeyError: > > > Traceback (most recent call last): > File "C:\Python\tabla.py", line 929, in -toplevel- > tablesDirectory = tablesDirectoryPrefix + os.env

Re: Import trouble

2004-12-15 Thread Craig Ringer
On Wed, 2004-12-15 at 21:45, Frans Englich wrote: > 2) I use Python modules which are not usually installed(libxml2/libxslt) and > want to fail gracefully in case the modules aren't available; print an > informative message. Since these imports are done in several related > programs, I don't wa

RE: KeyError

2004-12-15 Thread Doran_Dermot
Hi "R", The only explanation I can give is that the environment varialbe REMOTE_ADDR does not exist! Wrap your high-level code with try and except. Example: try: tablesDirectory = tablesDirectoryPrefix + os.environ['REMOTE_ADDR'] except KeyError: # Code to handle the fact tht REMOT_ADDR does

Re: Import trouble

2004-12-15 Thread Craig Ringer
On Wed, 2004-12-15 at 21:44, Craig Ringer wrote: > def import_xml: >try: >import libxml >except ImportError,err: ># handle the error >return libxml > > libxml = import_xml() Though my personal approach would actually be: try: import libxml except ImportError,e

Re: Import trouble

2004-12-15 Thread Frans Englich
On Wednesday 15 December 2004 13:44, Craig Ringer wrote: > On Wed, 2004-12-15 at 21:45, Frans Englich wrote: > > 2) I use Python modules which are not usually installed(libxml2/libxslt) > > and want to fail gracefully in case the modules aren't available; print > > an informative message. Since the

Re: Python IDE

2004-12-15 Thread Chris
Try WingIDE if you have some money (about 35 E/$ for the personal version) to spend, it's worth every (euro)cent. But please try SPE first, maybe that's enough for you. SPE? Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Python IDE

2004-12-15 Thread Frans Englich
On Wednesday 15 December 2004 13:59, Chris wrote: > > Try WingIDE if you have some money (about 35 E/$ for the personal > > version) to spend, it's worth every (euro)cent. But please try SPE > > first, maybe that's enough for you. > > SPE? After googling for "python spe", my guess is "SPE - Stani'

Re: Import trouble

2004-12-15 Thread Steve Holden
Frans Englich wrote: Hello all, I have a couple of questions related to module importing. 1) When I start my Python program with `python foo.py` instead of simply adding a interpreter comment on the first line and do `./foo.py`, some "local" imports fails, I guess because current working director

Re: KeyError

2004-12-15 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hello. > Maybe someone will help me with this KeyError: > > > Traceback (most recent call last): > File "C:\Python\tabla.py", line 929, in -toplevel- > tablesDirectory = tablesDirectoryPrefix + os.environ['REMOTE_ADDR'] > File "C:\Py

Import trouble

2004-12-15 Thread Frans Englich
Hello all, I have a couple of questions related to module importing. 1) When I start my Python program with `python foo.py` instead of simply adding a interpreter comment on the first line and do `./foo.py`, some "local" imports fails, I guess because current working directory is different. I

Re: getopt: Make argument mandatory

2004-12-15 Thread Fredrik Lundh
Frans Englich wrote: > In my use of getopt.getopt, I would like to make a certain parameter > mandatory. but you just did: >if configurationFile == "": >print "You must pass an URL/path to a configuration file, see > --help." >sys.exit(common.exitCodes["parameter"

Re: Why are tuples immutable?

2004-12-15 Thread Roel Schroeven
Antoon Pardon wrote: Op 2004-12-15, Fredrik Lundh schreef <[EMAIL PROTECTED]>: sorry, but I don't understand your reply at all. are you saying that dictionaries could support mutable keys (e.g lists) by making a copy of the key? how would such a dictionary pick up changes to the original key obj

Re: gather information from various files efficiently

2004-12-15 Thread Paul McGuire
"Klaus Neuner" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello, > > I need to gather information that is contained in various files. > > Like so: > > file1: > = > foo : 1 2 > bar : 2 4 > baz : 3 > = > > file2: > = > foo

RE: Import trouble

2004-12-15 Thread Doran_Dermot
Hi Craig, How about creating your own module that does this in __init__.py. You could create a directory (Eg craig_init) and in that directory create the file __init__.py containing the following code: try: import libxml except: # Blah, blah, blah. A clever bit of code goes here! WARNING: I

Re: Small Problem P 2.4 (line>2048 Bytes)

2004-12-15 Thread Walter Dörwald
>> [...] >> After search, I had found that the problem come from a "long line" (more >> than 2048 caracters), with begin : >> mappingcharmaj = { chr(97):'A', chr(98):'B', chr(99):'C', ... >> >> And, if I "break" in multiples lines, the problem is solved. This sounds like bug http://www.py

Re: flex/bison like module in Python?

2004-12-15 Thread Fredrik Lundh
Jerry Sievers wrote: > Curious if there exists in Python package(s) for use as lexer/parser > for implementation of language grammars? (s) indeed: http://www.nedbatchelder.com/text/python-parsers.html -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Python Test Environment

2004-12-15 Thread Fuzzyman
Sorry they're not reaching google groups, which is what I'm posting from. From http://groups-beta.google.com/group/comp.lang.python posts usually show up within a few minutes. The thing is, when I posted by email it showed up in seconds... Anyway - sorry about that and thanks for letti

Re: Why are tuples immutable?

2004-12-15 Thread Antoon Pardon
Op 2004-12-15, Roel Schroeven schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> Op 2004-12-15, Fredrik Lundh schreef <[EMAIL PROTECTED]>: >>>sorry, but I don't understand your reply at all. are you saying that >>>dictionaries >>>could support mutable keys (e.g lists) by making a copy of the

Re: Flow based programming & python coding style

2004-12-15 Thread Jp Calderone
On Wed, 15 Dec 2004 12:30:07 -0200, Carlos Ribeiro <[EMAIL PROTECTED]> wrote: >Hi, > > A friend of mine passed me some links about a great concept (not new > in fact, only new to me): > > -- http://www.jpaulmorrison.com/fbp/ > -- http://c2.com/cgi/wiki?FlowBasedProgramming > > I found many of

Re: getopt: Make argument mandatory

2004-12-15 Thread Diez B. Roggisch
> In my use of getopt.getopt, I would like to make a certain parameter > mandatory. I know how to specify such that a parameter must have a value > if it's specified, but I also want to make the parameter itself > mandatory(combined with a mandatory value, the result is that the user > must specify

Re: lies about OOP

2004-12-15 Thread Peter Hansen
Martijn Faassen wrote: Paul McGuire wrote: "Martijn Faassen" <[EMAIL PROTECTED]> wrote in message Yikes! (or better, "Jikes!" or even "Yijkes!"?) - my bad. And he was on faculty at UT right here in Austin, too. It's a very common mistake I've seen so often that for a while I wondered whether his

Re: Regular Expression

2004-12-15 Thread Michael McGarry
Philippe C. Martin wrote: I'm struggling myself and have bought: "Mastering Regular Expressions" 2nd Edition, O'REILLY Jeffrey E. F. Friedl I covers the reg exp concepts + applications in various languages (mostly PERL but some Python also) Thank you everyone for the tips!! -- http://mail.python

Re: Why are tuples immutable?

2004-12-15 Thread Jp Calderone
On Wed, 15 Dec 2004 14:18:21 GMT, Roel Schroeven <[EMAIL PROTECTED]> wrote: >Antoon Pardon wrote: > > Op 2004-12-15, Fredrik Lundh schreef <[EMAIL PROTECTED]>: > >>sorry, but I don't understand your reply at all. are you saying that > >>dictionaries > >>could support mutable keys (e.g lists) by

Re: flex/bison like module in Python?

2004-12-15 Thread wolfgang haefelinger
You may checkout www.antlr.org around Xmas - a extension for Python will be released. Regards, Wolfgang. "Jerry Sievers" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Dear Pythonists; > > Curious if there exists in Python package(s) for use as lexer/parser > for implementation

Re: Help need with converting Hex string to IEEE format float

2004-12-15 Thread Peter Hansen
Christos TZOTZIOY Georgiou wrote: s = "".join(x).decode("hex") I am not sure I remember in which version of Python the hex codec was added, but it is handy. Of course, binascii could do this since 2.0 or so, but not having to import another module *is* nice: >>> 'ff12'.decode('hex') '\xff\x12' >>>

Efficient grep using Python?

2004-12-15 Thread sf
Just started thinking about learning python. Is there any place where I can get some free examples, especially for following kind of problem ( it must be trivial for those using python) I have files A, and B each containing say 100,000 lines (each line=one string without any space) I want to do

Data problem

2004-12-15 Thread Jeffrey Maitland
Hello all, I am using the MySQLdb module and I am writing to a MySQL database. My write statement is something like. cursor.execute(“INSERT INTO Data(Name, X, Y, Z, Data)    VALUES('%s', '%s', '%s', '%f', '%f', '%f', '%s')""" %   

Re: Why are tuples immutable?

2004-12-15 Thread Steve Holden
Antoon Pardon wrote: Op 2004-12-15, Roel Schroeven schreef <[EMAIL PROTECTED]>: Antoon Pardon wrote: Op 2004-12-15, Fredrik Lundh schreef <[EMAIL PROTECTED]>: sorry, but I don't understand your reply at all. are you saying that dictionaries could support mutable keys (e.g lists) by making a copy

Re: Efficient grep using Python?

2004-12-15 Thread Fredrik Lundh
"sf" <[EMAIL PROTECTED]> wrote: > I have files A, and B each containing say 100,000 lines (each line=one > string without any space) > > I want to do > > " A - (A intersection B) " > > Essentially, want to do efficient grep, i..e from A remove those lines which > are also present in file B. th

Re: while 1 vs while True

2004-12-15 Thread Peter Hansen
Paul Rubin wrote: Nick Coghlan <[EMAIL PROTECTED]> writes: Until this code: .>>> import pdb .>>> pdb.True = 0 .>>> pdb.x = "Darn writeable module dictionaries" .>>> from pdb import True .>>> True 0 .>>> from pdb import x .>>> x 'Darn writeable module dictionaries' If Python really does behave that

Re: Efficient grep using Python?

2004-12-15 Thread P
sf wrote: Just started thinking about learning python. Is there any place where I can get some free examples, especially for following kind of problem ( it must be trivial for those using python) I have files A, and B each containing say 100,000 lines (each line=one string without any space) I want

Re: flex/bison like module in Python?

2004-12-15 Thread Jean Brouwers
For command line parsing, take a look at the shlex module, also in the standard distro. It may fit your requirements for additional functionality beyond cmd. /Jean Brouwers PS) We use SimpleParse/mxTextTools for parsing large log files, both are listed on the web page mentioned below. In addit

Re: Efficient grep using Python?

2004-12-15 Thread Tim Peters
["sf" <[EMAIL PROTECTED]>] >> I have files A, and B each containing say 100,000 lines (each >> line=one string without any space) >> >> I want to do >> >> " A - (A intersection B) " >> >> Essentially, want to do efficient grep, i..e from A remove those >> lines which are also present in file B.

Re: Data problem

2004-12-15 Thread Aaron Bingham
Jeffrey Maitland wrote: I am using the MySQLdb module and I am writing to a MySQL database. My write statement is something like. cursor.execute(“INSERT INTO Data(Name, X, Y, Z, Data) VALUES('%s', '%s', '%s', '%f', '%f', '%f', '%s')""" % (

Re: Efficient grep using Python?

2004-12-15 Thread John Hunter
> "sf" == sf <[EMAIL PROTECTED]> writes: sf> Just started thinking about learning python. Is there any sf> place where I can get some free examples, especially for sf> following kind of problem ( it must be trivial for those using sf> python) sf> I have files A, and B ea

Re: Flow based programming & python coding style

2004-12-15 Thread Carlos Ribeiro
On Wed, 15 Dec 2004 15:16:44 GMT, Jp Calderone <[EMAIL PROTECTED]> wrote: > > > On Wed, 15 Dec 2004 12:30:07 -0200, Carlos Ribeiro <[EMAIL PROTECTED]> wrote: > >Hi, > > > > A friend of mine passed me some links about a great concept (not new > > in fact, only new to me): > > > > -- http://www.jpa

Re: Fill a Server

2004-12-15 Thread Fredrik Lundh
<[EMAIL PROTECTED]> wrote: > Also, my first attempt at this did a recursive copy creating subdirs in > dirs as it copied. It would crash everytime it went 85 subdirs deep. > This is an NTFS filesystem. Would this limitation be in the filesystem > or Python? see the "Max File Name Length" on this

Re: Fill a Server

2004-12-15 Thread Fredrik Lundh
>> Also, my first attempt at this did a recursive copy creating subdirs in >> dirs as it copied. It would crash everytime it went 85 subdirs deep. >> This is an NTFS filesystem. Would this limitation be in the filesystem >> or Python? > > see the "Max File Name Length" on this page (random google

Re: Fill a Server

2004-12-15 Thread Peter Hansen
[EMAIL PROTECTED] wrote: [snip code involving copyfile:] shutil.copyfile(os.path.join(root, f), The problem with this is that it only copies about 35 GB/hour. I would like to copy at least 100 GB/hour... more if possible. I have tried to copy from the IDE CD drive to the SATA array with the same r

Re: Fill a Server

2004-12-15 Thread [EMAIL PROTECTED]
You are correct Peter, the exception read something like this: "Folder 85 not found." I am paraphrasing, but that is the crux of the error. It takes about an hour to produce the error so if you want an exact quote from the exception, let me know and give me awhile. I looked through the nested dir

Multithreading tkinter question

2004-12-15 Thread Mark English
Is there a safe way to run tkinter in a multithreaded app where the mainloop runs in a background thread ? Here's some test code demonstrating the problem. I'm running Python2.4 under Windows 2000. Code snip starts- from Tkinter import * def GetTkinterThread(): im

change windows system path from cygwin python?

2004-12-15 Thread gry
[Windows XP Pro, cygwin python 2.4, *nix hacker, windows newbie] I want to write some kind of install script for my python app that will add c:\cygwin\usr\bin to the system path. I don't want to walk around to 50 PC's and twiddle through the GUI to: My Computer --> Control Panel --> System --> A

Re: change windows system path from cygwin python?

2004-12-15 Thread Harlin Seritt
[EMAIL PROTECTED] wrote: > [Windows XP Pro, cygwin python 2.4, *nix hacker, windows newbie] > > I want to write some kind of install script for my python app that > will add c:\cygwin\usr\bin to the system path. I don't want > to walk around to 50 PC's and twiddle through the GUI to: > > My Com

Re: change windows system path from cygwin python?

2004-12-15 Thread Jeff Lindholm
> > I want to write some kind of install script for my python app that > will add c:\cygwin\usr\bin to the system path. I don't want > to walk around to 50 PC's and twiddle through the GUI to: > > My Computer --> Control Panel --> System --> Advanced --> Environment > > > How can a python, or even

Re: Efficient grep using Python?

2004-12-15 Thread Tim Peters
[Fredrik Lundh] >>> bdict = dict.fromkeys(open(bfile).readlines()) >>> >>> for line in open(afile): >>>if line not in bdict: >>>print line, >>> >>> [Tim Peters] >> Note that an open file is an iterable object, yielding the lines in >> the file. The "for" loop exploited that above, bu

Re: lies about OOP

2004-12-15 Thread H. S. Lahman
Responding to Beliavsky... Les Hatton "Does OO sync with the way we think?", IEEE Software, 15(3), p.46-54 "This paper argues from real data that OO based systems written in C++ appear to increase the cost of fixing defects significantly when compared with systems written in either C or Pascal. It

Re: Python IDE

2004-12-15 Thread fuzzylollipop
TruStudio for Eclipse is nice for those everything must be free socialists. ActiveState Komodo is probably the best commerical Python IDE and the ActiveState Python plugin for Visual Studio is great for those that do VS. -- http://mail.python.org/mailman/listinfo/python-list

Re: getopt: Make argument mandatory

2004-12-15 Thread Frans Englich
On Wednesday 15 December 2004 20:12, Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Frans Englich > > wrote: > > Hello, > > > > In my use of getopt.getopt, I would like to make a certain parameter > > mandatory. > > Isn't a *mandatory option* a contradiction? Why don't you turn it into

A beginner's problem...

2004-12-15 Thread Amir Dekel
Hello everyone, First, I have to say that Python is one of the coolest programing languages I have seen. And now for the problem (must be a silly one): When I import a module I have wrote, and then I find bugs, it seems that I can't import it again after a fix it. It always shows the same proble

Re: A beginner's problem...

2004-12-15 Thread Robert P. J. Day
On Wed, 15 Dec 2004, Amir Dekel wrote: > Hello everyone, > > First, I have to say that Python is one of the coolest programing languages I > have seen. > And now for the problem (must be a silly one): > When I import a module I have wrote, and then I find bugs, it seems that I > can't import it ag

Module question

2004-12-15 Thread Bill Turczyn
Does python have a module similiar to the perl Spreadsheet::WriteExcel Thanks, Bill -- http://mail.python.org/mailman/listinfo/python-list

Re: A beginner's problem...

2004-12-15 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Amir Dekel wrote: > When I import a module I have wrote, and then I find bugs, it seems that > I can't import it again after a fix it. It always shows the same > problem. I try del module but it doesn't work. > (I use Python 2.4 with the ActivePython pack (PythonWin IDE)

Re: New versions breaking extensions, etc.

2004-12-15 Thread David Bolen
"Martin v. Löwis" <[EMAIL PROTECTED]> writes: > Can you elaborate? To me, that problem only originates from > the OS lack of support for deleting open files. If you could > delete a shared libary that is still in use (as you can on > Unix), the put the new version of the DLL in the place, (...) N

Re: Step by step: Compiling extensions with MS Visual C++ Toolkit 2003 - msvccompiler-patch.txt (0/1)

2004-12-15 Thread Mike C. Fletcher
Martin Bless wrote: ... Two things first - not to forget: (1) In contrast to what Mike writes I had to use a different registry key (see step 9) Which is expected (even noted on the page), particularly if you have a different version of the SDKs. The keys in the patch were extracted from an E

Re: Performance (pystone) of python 2.4 lower then python 2.3 ???

2004-12-15 Thread Mark Asbach
Hi Lucas, > No,the reason that you see 2 times as many processors as really are > installed is the hyperthreading feature of the Xeon (see > http://www.infoworld.com/infoworld/article/02/02/25/020225plxeon_1.html) > > I turned it off (in the BIOS). The machine I tested on has 2 (pysical) > proc

Re: while 1 vs while True

2004-12-15 Thread Terry Reedy
> >>> import pdb > >>> pdb.x = "Darn writeable module dictionaries" > >>> from pdb import x > >>> x > >>>'Darn writeable module dictionaries' > If Python really does behave that way, that bug should be fixed > immediately. The fact that the attributes of Python modules, like those of classes (a

Re: lies about OOP

2004-12-15 Thread Martijn Faassen
Peter Hansen wrote: Martijn Faassen wrote: Paul McGuire wrote: "Martijn Faassen" <[EMAIL PROTECTED]> wrote in message Yikes! (or better, "Jikes!" or even "Yijkes!"?) - my bad. And he was on faculty at UT right here in Austin, too. It's a very common mistake I've seen so often that for a while I

Re: NO REALLY

2004-12-15 Thread Martijn Faassen
Jive wrote: Isn't there a comp.lang.flame or something? I've doublechecked, but I didn't see any significant flaming in this article (and I'm generally not very tolerant of it). My PSU posting was certainly not intended as a flame, in case that was misinterpreted. What'd I miss? Regards, Martijn

Re: from string to raw string

2004-12-15 Thread Scott David Daniels
Dan Perl wrote: Is there a way to convert a regular string to a raw string so that one could get from '\bblah' to r'\bblah' other than parsing the string and modifying the escapes? Assuming you might mean something else, that something else might be: s = r'no_tab_\t_here' len(s.split()) ==

Re: lies about OOP

2004-12-15 Thread Peter Hansen
Martijn Faassen wrote: Peter Hansen wrote: Well, in any case, thanks for setting the record straight, Martjin. That of course also happens to me once every while. I can take care of myself though -- Dijkstra however needs an advocate for the correct spelling of his name in this earthly realm. The

Re: NO REALLY

2004-12-15 Thread Peter Hansen
Martijn Faassen wrote: Jive wrote: Isn't there a comp.lang.flame or something? I've doublechecked, but I didn't see any significant flaming in this article (and I'm generally not very tolerant of it). My PSU posting was certainly not intended as a flame, in case that was misinterpreted. What'd I

Re: Module question

2004-12-15 Thread elbertlev
Goggle: keyword pyXLWriter - ported from Perl. Does not support newer exel files. F.e. if you create a table and write headers (names) they will be in the table as row 0. But it is fast and it works. Has a lot of examples. -- http://mail.python.org/mailman/listinfo/python-list

Dejavu 1.2.6, a Python ORM

2004-12-15 Thread Robert Brewer
The Dejavu Object-Relational Mapper (version 1.2.6) is now available and in the public domain. Get it at svn://casadeamor.com/dejavu/trunk. Dejavu is an Object-Relational Mapper for Python applications. It is designed to provide the "Model" third of an MVC application. Dejavu avoids making decisio

Re: Module question

2004-12-15 Thread Mike Meyer
Grumman <[EMAIL PROTECTED]> writes: > Bill Turczyn wrote: >> Does python have a module similiar to the perl Spreadsheet::WriteExcel >> Thanks, >> Bill >> > In a pinch, you can output an HTML table, give the file an .xls > extension, and Excel will read it just fine. Welll, someone pointed out a t

Re: How do I convert characters into integers?

2004-12-15 Thread Scott David Daniels
Markus Zeindl wrote: Hello, I want to write a simple encrypter, but I've got a problem: How can I convert characters into integers? Check this out, you'll like it even more than ord/chr: import array def mangle(message): a = array.array('B') a.fromstring(message)

Re: A beginner's problem...

2004-12-15 Thread DogWalker
"Marc 'BlackJack' Rintsch" <[EMAIL PROTECTED]> said: >In <[EMAIL PROTECTED]>, Amir Dekel wrote: > >> When I import a module I have wrote, and then I find bugs, it seems that >> I can't import it again after a fix it. It always shows the same >> problem. I try del module but it doesn't work. >> (

Re: Is Python good for graphics?

2004-12-15 Thread Esmail Bonakdarian
Fredrik Lundh wrote: how about: http://vpython.org/ hi, thanks, I didn't know about that. do you (or anyone else) have a recommendation for 2D type graphics? Thanks, Esmail -- http://mail.python.org/mailman/listinfo/python-list

Unpacking Binary Data - not using struct module

2004-12-15 Thread Geoffrey
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 "packed" data for

Re: NO REALLY

2004-12-15 Thread Peter Hansen
Brian van den Broek wrote: Peter Hansen said unto the world upon 2004-12-15 17:39: I could easily see this thread descending into a flame war in, oh, about another ten posts. That would be so freaky... Without a doubt that is the most ignorant and small-minded thought that ever has been, and ever

spawn* or exec* and fork, what should I use and how ?

2004-12-15 Thread Lingyun Yang
Hi, I want to use python as a "shell like" program, and execute an external program in it( such as mv, cp, tar, gnuplot) I tried: os.execv("/bin/bash",("/usr/bin/gnuplot",'-c "gnuplot < plot.tmp"')) since it's in a for-loop, it should be executed many times, but It exits after the first time runn

Re: spawn* or exec* and fork, what should I use and how ?

2004-12-15 Thread Binu K S
exec calls will replace the script process with the new process. >From the execv documentation: "These functions all execute a new program, replacing the current process; they do not return. On Unix, the new executable is loaded into the current process, and will have the same process ID as the ca

Re: spawn* or exec* and fork, what should I use and how ?

2004-12-15 Thread Lingyun Yang
Peter Hansen wrote: Lingyun Yang wrote: I want to use python as a "shell like" program, and execute an external program in it( such as mv, cp, tar, gnuplot) os.execv("/bin/bash",("/usr/bin/gnuplot",'-c "gnuplot < plot.tmp"')) I would suggest checking out the "subprocess" module, new in Python 2.

Re: ftp

2004-12-15 Thread Binu K S
Try retrbinary instead of retrlines in the original script (the one without write('\n')). retrlines fetches the file in ASCII mode and that must be altering the line terminations. On 15 Dec 2004 15:49:31 -0800, hawkmoon269 <[EMAIL PROTECTED]> wrote: > I would like to write a small ftp script that

Re: from string to raw string

2004-12-15 Thread Dan Perl
This is not what I meant. My posting was a judgement error. You are right though that my intuition was leading me to something like this. However, I didn't realize that it was not necessary for what I was doing. But this is very educational too. It made me look up string decode, encode, and

Re: lies about OOP

2004-12-15 Thread Andrew Dalke
Peter Hansen: > (Darn those Norwegians, influencing people's ideas of how a > name like Hansen ought to be spelled, grumble, grumble. And then there's my sister, a Nelson, who drove with friends of their's, the Olsons, to visit our aunt and uncle, the Larsons, and my grandmother, born a Hanson. S

Re: Performance (pystone) of python 2.4 lower then python 2.3 ???

2004-12-15 Thread Dan
Skip Montanaro wrote: Dan> I also see an 8-10% speed decrease in 2.4 (I built) from 2.3.3 Dan> (shipped w/Fedora2) in the program I'm writing (best of 3 trials Dan> each). Memory use seems to be about the same. How do you how the compiler flags were the same if you didn't compile both

Re: Zope side-by-side with Python 2.4

2004-12-15 Thread Terry Hancock
On Friday 03 December 2004 02:04 pm, Robert wrote: > If I have Python 2.4 installed and I want to install the latest stable > Zope, will Zope have problems or does Zope looks to its own setup and > not my install of Python 2.4? The latest version of Zope (2.7 or later) runs fine with Python 2.3 an

Re: Is Python good for graphics?

2004-12-15 Thread Robert Kern
Esmail Bonakdarian wrote: Fredrik Lundh wrote: how about: http://vpython.org/ hi, thanks, I didn't know about that. do you (or anyone else) have a recommendation for 2D type graphics? I like Kiva (but then, I also help develop it). The best place to get it right now is the SVN repository, but

  1   2   >