Re: ANN: Amara XML Toolkit 1.1.9

2006-09-19 Thread Uche Ogbuji
Apologies for the cross-post. I need to post a brief correction to the lists for the original announcement. Uche Ogbuji wrote: http://uche.ogbuji.net/tech/4suite/amara http://cheeseshop.python.org/pypi/Amara/ ftp://ftp.4suite.org/pub/Amara/ ... The original Windows installer EXEs posted for

Pydev 1.2.3 released

2006-09-19 Thread Fabio Zadrozny
Hi All, Pydev and Pydev Extensions 1.2.3 have been released Details on Pydev Extensions: http://www.fabioz.com/pydev Details on Pydev: http://pydev.sf.net Details on its development: http://pydev.blogspot.com Release Highlights in Pydev Extensions:

RELEASED Python 2.5 (FINAL)

2006-09-19 Thread Anthony Baxter
It's been nearly 20 months since the last major release of Python (2.4), and 5 months since the first alpha release of this cycle, so I'm absolutely thrilled to be able to say: On behalf of the Python development team and the Python community, I'm happy to announce the FINAL release

Re: How to efficiently proceed addition and subtraction in python list?

2006-09-19 Thread Chiucs
try this a=[1, 2, 3] b=a[:] Daniel Mark [EMAIL PROTECTED] ??? news:[EMAIL PROTECTED] ???... Hello all: I have a list AAA = [1, 2, 3] and would like to subtract one from list AAA so AAA' = [0, 1, 2] What should I do? Thank you -Daniel --

Re: How to efficiently proceed addition and subtraction in python list?

2006-09-19 Thread Paul Rubin
Daniel Mark [EMAIL PROTECTED] writes: I have a list AAA = [1, 2, 3] and would like to subtract one from list AAA so AAA' = [0, 1, 2] What should I do? BBB = [x-1 for x in AAA] -- http://mail.python.org/mailman/listinfo/python-list

Re: CONSTRUCT - Adding Functionality to the Overall System

2006-09-19 Thread Georg Brandl
Damjan wrote: I understand that I can use __metaclass__ to create a class which modifies the behaviour of another class. How can I add this metaclass to *all* classes in the system? (In ruby I would alter the Class class) You'd have to set __metaclass__ = whatever at the top of

Re: How to find number of characters in a unicode string?

2006-09-19 Thread Preben Randhol
On Mon, 18 Sep 2006 22:29:20 +0200 Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: Yes and you already seem to know the answer: Decode the byte string and use `len()` on the unicode string. .decode(utf-8) did the trick. Thanks! Preben -- http://mail.python.org/mailman/listinfo/python-list

Help

2006-09-19 Thread Rrajal
Hi there, I am new in this subject so could you please tell me from where I can get help (or good e-book) of python? -- http://mail.python.org/mailman/listinfo/python-list

Re: Help

2006-09-19 Thread Ben Finney
Rrajal [EMAIL PROTECTED] writes: Hi there, I am new in this subject so could you please tell me from where I can get help (or good e-book) of python? You need look no further than Python's own web site. URL:http://www.python.org/doc/ Of course, you *can* look further if you want to --

Re: why a main() function?

2006-09-19 Thread billie
Another advantage is that you can catch all the unhandled exceptions of the entire program (it they occurs) by doing something like this: def another_call(): raise SomeUnexpectedException # it will be catched in '__main__' def call(): another_call() def run(): call() in __name__

Re: How to efficiently proceed addition and subtraction in python list?

2006-09-19 Thread Ant
Tim Chase wrote: I have a list AAA = [1, 2, 3] and would like to subtract one from list AAA so AAA' = [0, 1, 2] What should I do? Sounds like a list comprehension to me: Also the built in function 'map' would work: a = [1,2,3] b = map(lambda x: x-1, a) b [0, 1, 2] List

Re: Python programs always open source?

2006-09-19 Thread Diez B. Roggisch
Ben Finney schrieb: Leif K-Brooks [EMAIL PROTECTED] writes: Ben Finney wrote: So long as you're not distributing some or all of Python itself, or a derivative work, the license for Python has no legal effect on what license you choose for your own work. I was replying to Ben Finney's

Re: CONSTRUCT - Adding Functionality to the Overall System

2006-09-19 Thread Diez B. Roggisch
I think '__metaclass__ = whatever' affects only the creation of classes that would otherwise be old-style classes? Wrong. If you set __metaclass__ = type, every class in that module will be new-style. If you set __metaclass__ = MyClass, and MyClass inherits from type, every class

Re: CONSTRUCT - Adding Functionality to the Overall System

2006-09-19 Thread Damjan
__metaclass__ = whatever at the top of each module whose classes are to get the new behavior. I think '__metaclass__ = whatever' affects only the creation of classes that would otherwise be old-style classes? Wrong. If you set __metaclass__ = type, every class in that module will be

Re: CONSTRUCT - Adding Functionality to the Overall System

2006-09-19 Thread Georg Brandl
Diez B. Roggisch wrote: I think '__metaclass__ = whatever' affects only the creation of classes that would otherwise be old-style classes? Wrong. If you set __metaclass__ = type, every class in that module will be new-style. If you set __metaclass__ = MyClass, and MyClass inherits

Re: Creating database structures in a portable way

2006-09-19 Thread Samuel
SQLAlchemy looks pretty good, but unfortunately apparently requires shell access for installation (or at least, I have not found any other solution covered in the docs), which I can not use. It doesn't use binaries AFAIK, so just copying should work as well. Indeed, from browsing the

ImportError: Don't know how to import XYZ (type code 3)

2006-09-19 Thread daniel
Trying to load a C++ module that is wrapped with boost_python and get the error ImportError: Don't know how to import XYZ (type code 3) I think type code 3 is means that it is a C++ wrapped .pyd. I have know idea what that means or how to fix it. Any ideas? D. --

Re: When is it a pointer (aka reference) - when is it a copy?

2006-09-19 Thread Magnus Lycka
Fredrik Lundh wrote: this article http://effbot.org/zone/python-objects.htm may be useful for those who haven't already seen it. I don't know how many times I've referred to, or paraphrased, that article. Shouldn't it be incorporated into the standard tutorial? I think it's very

Formatting device from a script on Windows

2006-09-19 Thread volcano
Hello, folks! Script I am creating has to format a device - USB flash drive. I have tried using regular DOS format through os.system - did not work well, because DOS format requires input from user. And the script should run without user interference. I have taken a look at ActivePython win32...

Re: When is it a pointer (aka reference) - when is it a copy?

2006-09-19 Thread GHUM
Magnus Lycka schrieb: http://effbot.org/zone/python-objects.htm may be useful for those who haven't already seen it. Shouldn't it be incorporated into the standard tutorial? I think it's very helpful for people who are used to the way C etc handles variables. That would also be a good

Re: When is it a pointer (aka reference) - when is it a copy?

2006-09-19 Thread Simon Brunning
On 9/19/06, Magnus Lycka [EMAIL PROTECTED] wrote: Fredrik Lundh wrote: this article http://effbot.org/zone/python-objects.htm may be useful for those who haven't already seen it. I don't know how many times I've referred to, or paraphrased, that article. Shouldn't it be

Re: Formatting device from a script on Windows

2006-09-19 Thread weir
this may help, you need ctypes module. ## from ctypes import * fm = windll.LoadLibrary('fmifs.dll') def myFmtCallback(command, modifier, arg): print command return 1# TRUE FMT_CB_FUNC = WINFUNCTYPE(c_int, c_int, c_int, c_void_p) FMIFS_HARDDISK = 0x0C

Re: Python programs always open source?

2006-09-19 Thread [EMAIL PROTECTED]
Diez B. Roggisch wrote: Ben Finney schrieb: Ben Finney wrote: So long as you're not distributing some or all of Python itself, or a derivative work, the license for Python has no legal effect on what license you choose for your own work. [SNIP] My claim (and IANAL) is that it doesn't

Re: why a main() function?

2006-09-19 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: Others have already told you the most important things. There is another secondary advantage: the code inside a function runs faster (something related is true for C programs too). Usually this isn't important, but for certain programs they can go 20%+ faster. I

Re: why a main() function?

2006-09-19 Thread Simon Brunning
On 9/19/06, Diez B. Roggisch [EMAIL PROTECTED] wrote: I totally fail to see why that should be the case - for python as well as for C. If you put your code into a main() function, all the names that it binds are in the function's local scope, whereas if the code is in the module's top level,

Re: Python programs always open source?

2006-09-19 Thread Ben Finney
Diez B. Roggisch [EMAIL PROTECTED] writes: Ben Finney schrieb: My claim (and IANAL) is that it doesn't matter *what* license Python is distributed under; unless you do something with Python that is a right of the copyright holder, such as distributing part or all of Python, the copyright

Re: why a main() function?

2006-09-19 Thread Fredrik Lundh
Diez B. Roggisch wrote: There is another secondary advantage: the code inside a function runs faster (something related is true for C programs too). Usually this isn't important, but for certain programs they can go 20%+ faster. I totally fail to see why that should be the case - for python

Re: why a main() function?

2006-09-19 Thread Peter Otten
Diez B. Roggisch wrote: [EMAIL PROTECTED] wrote: Others have already told you the most important things. There is another secondary advantage: the code inside a function runs faster (something related is true for C programs too). Usually this isn't important, but for certain programs

Writing Video conference software for Windows

2006-09-19 Thread Paolo Pantaleo
Hi, I need to write a software that allow to see the desktop and hear the microphone capture of a remote PC across a network. I need to do that for a unviresity assignement. The software must run on Windows. Since I like Python very much I am thinking to write that software in Python. Do you

Re: Formatting device from a script on Windows

2006-09-19 Thread volcano
weir wrote: this may help, you need ctypes module. ## from ctypes import * fm = windll.LoadLibrary('fmifs.dll') def myFmtCallback(command, modifier, arg): print command return 1 # TRUE FMT_CB_FUNC = WINFUNCTYPE(c_int, c_int, c_int, c_void_p)

Installing Python on a 64-Bit OS

2006-09-19 Thread Nico Grubert
Hi there, I'd like to install Python 2.3.5. on a 64-Bit OS (Suse Linux Enterprise Server 10) on an AMD Opteron 64-Bit machine. I have to use Python 2.3.5. Do I need a special source archive or can I use Python-2.3.5.tgz from http://www.python.org/ftp/python/2.3.5/Python-2.3.5.tgz ? Is there

Compile AST to bytecode?

2006-09-19 Thread Rob De Almeida
Hi, I would like to compile an AST to bytecode, so I can eval it later. I tried using parse.compileast, but it fails: import compiler, parser ast = compiler.parse(42) parser.compileast(ast) Traceback (most recent call last): File stdin, line 1, in ? TypeError: compilest() argument 1 must be

Re: Installing Python on a 64-Bit OS

2006-09-19 Thread Ivan Voras
Nico Grubert wrote: Is there anything special I have to care about or is installing Python on a 64 Bit OS just as easy as installing it on a 32-Bit OS? It is as easy. Look around, you'll probably find a pre-built binary package for your OS. --

Re: [ANN] Code Golf Challenge : 1,000 Digits Of Pi

2006-09-19 Thread Neil Cerutti
On 2006-09-18, Calvin Spealman [EMAIL PROTECTED] wrote: Just once, I would like to see a programming contest that was judged on the quality of your code, not the number of bytes you managed to incomprehensively hack it down to. Check out the ICFP Functional Programming Contest. Most of the

Re: How to efficiently proceed addition and subtraction in python list?

2006-09-19 Thread Steve Holden
Ant wrote: Tim Chase wrote: I have a list AAA = [1, 2, 3] and would like to subtract one from list AAA so AAA' = [0, 1, 2] What should I do? Sounds like a list comprehension to me: Also the built in function 'map' would work: a = [1,2,3] b = map(lambda x: x-1, a) b [0, 1, 2]

Re: How to efficiently proceed addition and subtraction in pythonlist?

2006-09-19 Thread Fredrik Lundh
Steve Holden wrote: And statements like that are probably going to annoy me ;-) t = timeit.Timer(b = map(lambda x: x-1, a), setup=a=[1,2,3]) t.timeit() 2.4686168214116599 t = timeit.Timer(b = [x-1 for x in a], setup=a=[1,2,3]) t.timeit() 0.9930245324475635 And now someone's

Re: How to efficiently proceed addition and subtraction in pythonlist?

2006-09-19 Thread Steve Holden
Fredrik Lundh wrote: Steve Holden wrote: And statements like that are probably going to annoy me ;-) t = timeit.Timer(b = map(lambda x: x-1, a), setup=a=[1,2,3]) t.timeit() 2.4686168214116599 t = timeit.Timer(b = [x-1 for x in a], setup=a=[1,2,3]) t.timeit() 0.9930245324475635

RELEASED Python 2.5 (FINAL)

2006-09-19 Thread Anthony Baxter
It's been nearly 20 months since the last major release of Python (2.4), and 5 months since the first alpha release of this cycle, so I'm absolutely thrilled to be able to say: On behalf of the Python development team and the Python community, I'm happy to announce the FINAL release

Re: Installing Python on a 64-Bit OS

2006-09-19 Thread Steve Holden
Nico Grubert wrote: Hi there, I'd like to install Python 2.3.5. on a 64-Bit OS (Suse Linux Enterprise Server 10) on an AMD Opteron 64-Bit machine. I have to use Python 2.3.5. Do I need a special source archive or can I use Python-2.3.5.tgz from

Re: Compile AST to bytecode?

2006-09-19 Thread Duncan Booth
Rob De Almeida [EMAIL PROTECTED] wrote: I would like to compile an AST to bytecode, so I can eval it later. I tried using parse.compileast, but it fails: import compiler, parser ast = compiler.parse(42) parser.compileast(ast) Traceback (most recent call last): File stdin, line 1, in ?

Re: Installing Python on a 64-Bit OS

2006-09-19 Thread Steve Holden
Steve Holden wrote: Nico Grubert wrote: Hi there, I'd like to install Python 2.3.5. on a 64-Bit OS (Suse Linux Enterprise Server 10) on an AMD Opteron 64-Bit machine. I have to use Python 2.3.5. Do I need a special source archive or can I use Python-2.3.5.tgz from

Re: Installing Python on a 64-Bit OS

2006-09-19 Thread Anthony Baxter
More recent versions of Python have incorporated much more support for 64-bit architectures. 2.5 is about to be released (I believe it should be out in the next 24 hours), and I'd recommend that over the older version you are considering. If by 24 hours you mean 20 minutes ago, this is

Re: How to efficiently proceed addition and subtraction in pythonlist?

2006-09-19 Thread Ant
Steve Holden wrote: Fredrik Lundh wrote: Steve Holden wrote: ... if performance is *really* important, you need to benchmark both options Fair point. -- http://mail.python.org/mailman/listinfo/python-list

Re: Installing Python on a 64-Bit OS

2006-09-19 Thread Daniel Dittmar
Nico Grubert wrote: I'd like to install Python 2.3.5. on a 64-Bit OS (Suse Linux Enterprise Server 10) on an AMD Opteron 64-Bit machine. I have to use Python 2.3.5. Do I need a special source archive or can I use Python-2.3.5.tgz from

Re: Formatting device from a script on Windows

2006-09-19 Thread volcano
OK, it worked. Obviosly, quick format was a bad choice. Thanks a lot for your help! Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: How to efficiently proceed addition and subtraction in python list?

2006-09-19 Thread Simon Brunning
On 18 Sep 2006 15:43:31 -0700, Daniel Mark [EMAIL PROTECTED] wrote: Hello all: I have a list AAA = [1, 2, 3] and would like to subtract one from list AAA so AAA' = [0, 1, 2] You've had some excellent suggestions as to how to go about this assuming that by efficient you mean in terms of CPU.

Re: Compile AST to bytecode?

2006-09-19 Thread Rob De Almeida
Duncan Booth wrote: I would like to compile an AST to bytecode, so I can eval it later. I'm not sure there are any properly documented functions for converting an AST to a code object, so your best bet may be to examine what a pycodegen class like Expression or Module actually does. Thanks,

I need some tips to begin a simple project

2006-09-19 Thread dutche
Hi, I'm new in Python and I'm learning with Learning Python oreilly's book which is very good written and explanatory. Now, that I know a bit of Python, I want to make some simple project, I thought something like a menu, just like kxdocks menu or something like that, with transparency and all

Re: Installing Python on a 64-Bit OS

2006-09-19 Thread Steve Holden
Anthony Baxter wrote: More recent versions of Python have incorporated much more support for 64-bit architectures. 2.5 is about to be released (I believe it should be out in the next 24 hours), and I'd recommend that over the older version you are considering. If by 24 hours you mean 20

win32 Service: path to .py script

2006-09-19 Thread Gregor Horvath
Hi, I have a testservice.py (see below). I installed the Windows-Service successfully. (via commandlineoption install) The problem is that it runs only when it is in c:\windows\system32 or in the python path. I added the desired path (Y:\) to the PYTHONPATH environment variable for the system

Re: CONSTRUCT - Adding Functionality to the Overall System

2006-09-19 Thread Ilias Lazaridis
Ilias Lazaridis wrote: I understand that I can use __metaclass__ to create a class which modifies the behaviour of another class. How can I add this metaclass to *all* classes in the system? (In ruby I would alter the Class class) I got confused from the discussion about __metaclass__.

Installing 2.5 with 2.4?

2006-09-19 Thread John Salerno
Hi all. Just curious, before I do it myself, about the best way to install 2.5 if it's the only version I want to use. Should I uninstall 2.4 first? Does 2.5 replace 2.4? I doubt the latter, but if I install 2.5, does that mean I need to reinstall all the extensions I had for 2.4 again, or

Pyglade, gtk, howto write more efficiently, and waste less code?

2006-09-19 Thread Pipiten
Hi everybody, i` m new in this group, and python so.., my greetings to everybody here. I wrote a little program, in wich i do this: (I have several Select File buttons, one for each file (in this case, an image) wich has an text_entry, so i can add a comment for each picture.) def

Re: Installing 2.5 with 2.4?

2006-09-19 Thread Fredrik Lundh
John Salerno wrote: Hi all. Just curious, before I do it myself, about the best way to install 2.5 if it's the only version I want to use. Should I uninstall 2.4 first? if you don't plan to use it anymore, yes. Does 2.5 replace 2.4? no. I doubt the latter, but if I install 2.5, does

Re: CONSTRUCT - Adding Functionality to the Overall System

2006-09-19 Thread Diez B. Roggisch
Ilias Lazaridis wrote: Ilias Lazaridis wrote: I understand that I can use __metaclass__ to create a class which modifies the behaviour of another class. How can I add this metaclass to *all* classes in the system? (In ruby I would alter the Class class) I got confused from the

Re: Installing 2.5 with 2.4?

2006-09-19 Thread Diez B. Roggisch
John Salerno wrote: Hi all. Just curious, before I do it myself, about the best way to install 2.5 if it's the only version I want to use. Should I uninstall 2.4 first? Does 2.5 replace 2.4? I doubt the latter, but if I install 2.5, does that mean I need to reinstall all the extensions I had

Re: Installing 2.5 with 2.4?

2006-09-19 Thread John Salerno
Diez B. Roggisch wrote: John Salerno wrote: Hi all. Just curious, before I do it myself, about the best way to install 2.5 if it's the only version I want to use. Should I uninstall 2.4 first? Does 2.5 replace 2.4? I doubt the latter, but if I install 2.5, does that mean I need to reinstall

Re: why a main() function?

2006-09-19 Thread Diez B. Roggisch
Fredrik Lundh wrote: Diez B. Roggisch wrote: There is another secondary advantage: the code inside a function runs faster (something related is true for C programs too). Usually this isn't important, but for certain programs they can go 20%+ faster. I totally fail to see why that should

Re: why a main() function?

2006-09-19 Thread Paul Rubin
Diez B. Roggisch [EMAIL PROTECTED] writes: Python stores local variables in an indexed array, but globals in a dictionary. Looking things up by index is faster than looking them up by name. Interesting. How is the index computed? I would have assumed that locals() is somehow used, which

Re: Pyglade, gtk, howto write more efficiently, and waste less code?

2006-09-19 Thread [EMAIL PROTECTED]
Pipiten wrote: Hi everybody, i` m new in this group, and python so.., my greetings to everybody here. I wrote a little program, in wich i do this: (I have several Select File buttons, one for each file (in this case, an image) wich has an text_entry, so i can add a comment for each

Re: why a main() function?

2006-09-19 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Paul Rubin wrote: Diez B. Roggisch [EMAIL PROTECTED] writes: Python stores local variables in an indexed array, but globals in a dictionary. Looking things up by index is faster than looking them up by name. Interesting. How is the index computed? I would have

Re: why a main() function?

2006-09-19 Thread Fredrik Lundh
Diez B. Roggisch wrote: Interesting. How is the index computed? I would have assumed that locals() is somehow used, which is a dicht. I can imagine enumerating left-hand-side names and trying to replace their occurence with the index, falling back to the name if that is not possible/the

Re: Python programs always open source?

2006-09-19 Thread Chris Lambacher
On Tue, Sep 19, 2006 at 09:46:13PM +1000, Ben Finney wrote: Diez B. Roggisch [EMAIL PROTECTED] writes: Ben Finney schrieb: My claim (and IANAL) is that it doesn't matter *what* license Python is distributed under; unless you do something with Python that is a right of the copyright

newlines and sax.saxutils.quoteattr

2006-09-19 Thread Edward K. Ream
Hello all, I recently ran across a situation in which sax.saxutils.quoteattr did not work as I expected. I am writing Leo outlines as opml files http://en.wikipedia.org/wiki/OPML which forces me to write python code in xml attributes rather than xml elements (as is done in .leo files). The

Re: why a main() function?

2006-09-19 Thread Steven Bethard
Steve Holden wrote: [EMAIL PROTECTED] wrote: I think I read a suggestion somewhere to wrap the code where a Python script starts in a main() function, so one has def main(): print hi main() instead of print hi What are the advantages of doing this? Guido van Rossum himself can

Re: win32 Service: path to .py script

2006-09-19 Thread Larry Bates
Gregor Horvath wrote: Hi, I have a testservice.py (see below). I installed the Windows-Service successfully. (via commandlineoption install) The problem is that it runs only when it is in c:\windows\system32 or in the python path. I added the desired path (Y:\) to the PYTHONPATH

Re: Compile AST to bytecode?

2006-09-19 Thread fumanchu
Rob De Almeida wrote: Duncan Booth wrote: I would like to compile an AST to bytecode, so I can eval it later. I'm not sure there are any properly documented functions for converting an AST to a code object, so your best bet may be to examine what a pycodegen class like Expression or

Re: CONSTRUCT - Adding Functionality to the Overall System

2006-09-19 Thread MonkeeSage
Ilias Lazaridis wrote: How do I do this? It's easy: def writeDebug(msg): print I do not debug things, I _evaluate_ with professionals on the industries! See ticket 547!\n \ Oh yeah, and %s % msg ... class Foo: writeDebug(how can I configure the interpreter for understand Klingon

Re: Threads blocking on OpenBSD w/ Python 2.4.2

2006-09-19 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: I'm attempting to write a faily simple threaded app that fires off a thread to select() on a FIFO while the main loop handles data read from that pipe and a few other tasks. For some reason, calls to time.sleep() seem to block until the first time data is dumped into

Pydev 1.2.3 released

2006-09-19 Thread Fabio Zadrozny
Hi All, Pydev and Pydev Extensions 1.2.3 have been released Details on Pydev Extensions: http://www.fabioz.com/pydev Details on Pydev: http://pydev.sf.net Details on its development: http://pydev.blogspot.com Release Highlights in Pydev Extensions:

Re: Installing 2.5 with 2.4?

2006-09-19 Thread John Machin
John Salerno wrote: Diez B. Roggisch wrote: John Salerno wrote: Hi all. Just curious, before I do it myself, about the best way to install 2.5 if it's the only version I want to use. Should I uninstall 2.4 first? Does 2.5 replace 2.4? I doubt the latter, but if I install 2.5, does

Re: newlines and sax.saxutils.quoteattr

2006-09-19 Thread Fredrik Lundh
Edward K. Ream wrote: - Does anyone know whether this is guaranteed to be a general solution? That is, are sax parsers *obliged* to ignore newlines in attributes? http://www.w3.org/TR/REC-xml/#AVNormalize - If sax parsers are indeed obliged to ignore newlines in attributes, would it

Re: I need some tips to begin a simple project

2006-09-19 Thread Simon Hibbs
PyGame is in it, right? Python comes with a basic GUI toolkit called Tk with basic stuff such as buttons, text and graphics widgets, menus, etc. PyGame is a seperate package that you can download that makes it fairly easy to create games. There are also additional libraries that make PyGame

Re: CONSTRUCT - Adding Functionality to the Overall System

2006-09-19 Thread Ilias Lazaridis
Diez B. Roggisch wrote: Ilias Lazaridis wrote: Ilias Lazaridis wrote: I understand that I can use __metaclass__ to create a class which modifies the behaviour of another class. How can I add this metaclass to *all* classes in the system? (In ruby I would alter the Class class) I

Re: CONSTRUCT - Adding Functionality to the Overall System

2006-09-19 Thread Ilias Lazaridis
MonkeeSage wrote: Ilias Lazaridis wrote: How do I do this? It's easy: def writeDebug(msg): print I do not debug things, I _evaluate_ with professionals on the industries! See ticket 547!\n \ Oh yeah, and %s % msg where do I place this function... ... class Foo:

Re: Writing Video conference software for Windows

2006-09-19 Thread Jordan
If you're going to need win32 system access use the win32all python extension (very, very good extension). Do you need single frame image capture, or constant video stream? PIL can be used for the first, it might also be usable for video, I'm not sure. For sound, python comes with some built in

ANN: Python Molecular Viewer - 1.4.3

2006-09-19 Thread sargis
We are pleased to announce version 1.4.3 of our software tools including: PMV, ADT and VISION. Binary (LINUX, Mac OS X and Windows) and Source distributions can be downloaded from: http://mgltools.scripps.edu/downloads NEW FEATURES: -- PMV: - added support for

Tkinter and ActiveX event

2006-09-19 Thread swell
Hi, I want to integrate into an GUI a activeX component that generate some events. What i have done is : - Create the activeX component ( DispatchWithEvents method ) - create the GUI - app.mainloop() My pb is that i don't know how to take into account the events generated by the activeX

Curious issue with simple code

2006-09-19 Thread codefire
Hi, I have some simple code - which works...kind of..here's the code: [code] import os def print_tree(start_dir): for f in os.listdir(start_dir): fp = os.path.join(start_dir, f) print fp if os.path.isfile(fp): # will return false if use f here! if

Re: newlines and sax.saxutils.quoteattr

2006-09-19 Thread Edward K. Ream
Thanks, Fredrik, for the reference to the attribute normalization algorithm. I guess it's too late to fix OPML. It's too late for OPML 1. I'll check with Dave Winer about OPML 2. Edward Edward K. Ream email: [EMAIL

Re: I need some tips to begin a simple project

2006-09-19 Thread codefire
dutche wrote: Now, that I know a bit of Python, I want to make some simple project, I thought something like a menu, just like kxdocks menu or something like that, with transparency and all with xml. But I dont know what things I have to know. Start with some simple non-gui apps first. How

Re: win32 Service: path to .py script

2006-09-19 Thread Gregor Horvath
Larry Bates schrieb: I believe that your problem is that services run under Local System account. Normally Local System account would not have a drive mapping Y:\. You can change the account that a service You are absolutly correct. I moved the script to a local drive instead of a mapped

Re: CONSTRUCT - Adding Functionality to the Overall System

2006-09-19 Thread MonkeeSage
Ilias Lazaridis wrote: where do I place this function... The place where you want it to be. ...thus it becomes available within class Foo and all other Classes? Anything defined in the top-level (i.e., the sys.modules['__main__'] namespace) is accessible in every scope...but I assume you

Re: Curious issue with simple code

2006-09-19 Thread Fredrik Lundh
codefire wrote: As above it all works as expected. However, on the marked line, if I use f instead of fp then that condition returns false! Surely, isfile(f) should return true, even if I just give a filename, rather than the full path? try printing both f and fp, and see if you can tell

RE: Curious issue with simple code

2006-09-19 Thread Richard Morello
Dear Tony, You're not in that directory (start_dir) when the isfile() function is called. See function os.path.curdir() and os.chdir(). Also, you may be confusing the behavior of os.path.walk(), in which the function called will happen once you have been chdired to the directory it is

Re: Curious issue with simple code

2006-09-19 Thread Diez B. Roggisch
codefire wrote: Hi, I have some simple code - which works...kind of..here's the code: [code] import os def print_tree(start_dir): for f in os.listdir(start_dir): fp = os.path.join(start_dir, f) print fp if os.path.isfile(fp): # will return false if use f

Re: Curious issue with simple code

2006-09-19 Thread MonkeeSage
codefire wrote: As above it all works as expected. However, on the marked line, if I use f instead of fp then that condition returns false! Surely, isfile(f) should return true, even if I just give a filename, rather than the full path? Hi Tony, Actually the file is in a different directory

Re: Curious issue with simple code

2006-09-19 Thread Tim Chase
[code] import os def print_tree(start_dir): for f in os.listdir(start_dir): fp = os.path.join(start_dir, f) print fp if os.path.isfile(fp): # will return false if use f here! if os.path.splitext(fp)[1] == '.html': print

Re: Curious issue with simple code

2006-09-19 Thread codefire
Ah of course, isfile(f) can only return true if it can find f! :) I'm going to investigate those other functions too :) Thanks a lot guys! Tony -- http://mail.python.org/mailman/listinfo/python-list

help with relative imports

2006-09-19 Thread John Salerno
I'm reading the What's New section of the 2.5 docs, and I'm a little confused by the last section of Absolute and Relative Imports: --- For example, code in the A.B.C module can do: from . import D # Imports A.B.D from .. import E

Re: Installing 2.5 with 2.4?

2006-09-19 Thread John Salerno
John Machin wrote: I'd suggest that you uninstall 2.4 later if at all. Ensure that you have got all the extensions you want/need for 2.5 before you burn your boats. As Diez says in effect, there is no guarantee that any particular extension is available for 2.5 on Windows right now. Thanks

Re: CONSTRUCT - Adding Functionality to the Overall System

2006-09-19 Thread Steve Holden
Ilias Lazaridis wrote: MonkeeSage wrote: Ilias Lazaridis wrote: How do I do this? It's easy: def writeDebug(msg): print I do not debug things, I _evaluate_ with professionals on the industries! See ticket 547!\n \ Oh yeah, and %s % msg where do I place this function... ...

Re: help with relative imports

2006-09-19 Thread Robert Kern
John Salerno wrote: I'm reading the What's New section of the 2.5 docs, and I'm a little confused by the last section of Absolute and Relative Imports: --- For example, code in the A.B.C module can do: from . import D # Imports

Re: Mechanoid Web Browser - Recording Capability

2006-09-19 Thread John J. Lee
Seymour [EMAIL PROTECTED] writes: Somehow I had the notion that Mechanize was a Pearl script. mechanize the Python module started as a port of Andy Lester's Perl module WWW::Mechanize (in turn based on Gisle Aas' libwww-perl), and on some very high level has the same conceptual interface, but

Python 2.5 slower with pyparsing 1.4.3

2006-09-19 Thread Paul McGuire
Running my Verilog parser tests, I get a 5-10% slowdown with Python 2.5 vs. Python 2.4.1 (See http://pyparsing.wikispaces.com/News.) I apologize for not running performance tests sooner, I only ran regression tests on the release candidates, and those were all okay. I'll look through the

Re: Installing Python on a 64-Bit OS

2006-09-19 Thread Martin v. Löwis
Nico Grubert schrieb: Is there anything special I have to care about or is installing Python on a 64 Bit OS just as easy as installing it on a 32-Bit OS? Despite what everybody else said: most likely, special care is necessary. However, nobody probably knows what precisely you need to be aware

Re: Mechanoid Web Browser - Recording Capability

2006-09-19 Thread John J. Lee
Seymour [EMAIL PROTECTED] writes: [...] one program, MaxQ, that records web surfing. It seems to work great. [...] There are lots of such programs about (ISTR twill used to use MaxQ for its recording feature, but I think Titus got rid of it in favour of his own code, for some reason). How

Re: help with relative imports

2006-09-19 Thread John Salerno
Robert Kern wrote: What is ambiguous about A.B.D, A.E, and A.F.G? But if you like: I guess maybe I was looking at it backwards. From the way it was worded, I thought the only information we had to use was the structure A.B.C, and then given a statement like: from . import D we just had to

Re: Nano Technology Application For Health,Wellness and Beauty

2006-09-19 Thread Paul McGuire
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dear lovely moderator, please allow me to spread this information, somebody might need it, please forgive me if you are bothered Dear All, this might be useful for you and your family snip Does it also predict earthquakes? For your

new string method in 2.5 (partition)

2006-09-19 Thread John Salerno
Forgive my excitement, especially if you are already aware of this, but this seems like the kind of feature that is easily overlooked (yet could be very useful): Both 8-bit and Unicode strings have new partition(sep) and rpartition(sep) methods that simplify a common use case. The find(S)

  1   2   >