Jinja 1.0 Released

2007-03-24 Thread Armin Ronacher
Jinja 1.0 Released == Jinja 1.0 is out now. Jinja is a sandboxed template engine written in pure Python licensed under the BSD license. It provides a Django-like non-XML syntax and compiles templates into executable python code. It's basically a combination of Django templates

Re: Multi-line strings with formatting

2007-03-24 Thread Steven Bethard
On Fri, 2007-03-23 at 09:54 -0700, [EMAIL PROTECTED] wrote: When constructing a particularly long and complicated command to be sent to the shell, I usually do something like this, to make the command as easy as possible to follow: commands.getoutput( 'mycommand -S %d -T %d ' %

Re: On text processing

2007-03-24 Thread Daniel Nogradi
I'm in a process of rewriting a bash/awk/sed script -- that grew to big -- in python. I can rewrite it in a simple line-by-line way but that results in ugly python code and I'm sure there is a simple pythonic way. The bash script processed text files of the form:

Re: Python object overhead?

2007-03-24 Thread John Machin
On 24/03/2007 8:11 AM, Matt Garman wrote: I'm trying to use Python to work with large pipe ('|') delimited data files. The files range in size from 25 MB to 200 MB. Since each line corresponds to a record, what I'm trying to do is create an object from each record. An object with only 1

Re: Making a non-root daemon process

2007-03-24 Thread Ben Finney
Ben Finney [EMAIL PROTECTED] writes: Hmm. I typed the example program in as a simplified version of what I'm doing; but didn't actually *run* it. When I do run it, I get no exception, as you say. Now I'll have to find out what significant difference there is between my failing code and this

execution speed increase after compile py code into exe?

2007-03-24 Thread Kelie
hello, would there be any speed increase in code execution after python code being compiled into exe file with py2exe? thanks, kelie -- http://mail.python.org/mailman/listinfo/python-list

Re: execution speed increase after compile py code into exe?

2007-03-24 Thread Michael Bentley
would there be any speed increase in code execution after python code being compiled into exe file with py2exe? No. I would expect slower startup followed by the same code execution time you'd get from running normally (not that I've actually tested it, mind you). regards, Michael

Re: execution speed increase after compile py code into exe?

2007-03-24 Thread Paul Rudin
Kelie [EMAIL PROTECTED] writes: hello, would there be any speed increase in code execution after python code being compiled into exe file with py2exe? AIUI that's not what p2yexe is about - it's essentially about packaging up your python program for ease of distribution and installation on

Re: execution speed increase after compile py code into exe?

2007-03-24 Thread Will McGugan
Michael Bentley wrote: would there be any speed increase in code execution after python code being compiled into exe file with py2exe? No. I would expect slower startup followed by the same code execution time you'd get from running normally (not that I've actually tested it, mind

Re: creating jsp-like tool with python

2007-03-24 Thread Kushal Kumaran
On Mar 24, 6:18 am, jd [EMAIL PROTECTED] wrote: I'd like to create a program that takes files with jsp-like markup and processes the embedded code (which would be python) to produce the output file. There would be two kinds of sections in the markup file: python code to be evaluated, and

Re: execution speed increase after compile py code into exe?

2007-03-24 Thread Michael Bentley
Actualy startup is faster for the apps that I have py2exe'd. I think this may be because all the modules are in one place and Python doesn't have to go searching for them. Thanks, Will! That's good to know. -- http://mail.python.org/mailman/listinfo/python-list

Re: Join strings - very simple Q.

2007-03-24 Thread Dustan
On Mar 23, 1:30 pm, Paulo da Silva [EMAIL PROTECTED] wrote: Mike Kent escreveu: ... New way: l=['a','b','c'] jl=','.join(l) I thank you all. Almost there ... I tried .join(l,',') but no success ... :-( Paulo Perhaps you're doing it wrong, despite having an example right in front

Re: Create new processes over telnet in XP

2007-03-24 Thread Thomas Heller
Irmen de Jong schrieb: Shane Geiger wrote: This reminds me of something I once wanted to do: How can I install Python in a totally non-gui way on Windows (without the use of VNC)? I think I was telnetted into a computer (or something like that) and I was unable to run the usual Python

Re: Join strings - very simple Q.

2007-03-24 Thread Dustan
On Mar 24, 5:59 am, Dustan [EMAIL PROTECTED] wrote: On Mar 23, 1:30 pm, Paulo da Silva [EMAIL PROTECTED] wrote: Mike Kent escreveu: ... New way: l=['a','b','c'] jl=','.join(l) I thank you all. Almost there ... I tried .join(l,',') but no success ... :-( Paulo Perhaps

Re: Join strings - very simple Q.

2007-03-24 Thread Shane Geiger
import string def test_join(l): print Joining with commas: , string.join(l,',') print Joining with empty string: , string.join(l,'') print Joining same way, using another syntax: , ''.join(l) print Joining with the letter X: ,

Re: Create new processes over telnet in XP

2007-03-24 Thread Rob Wolfe
Godzilla [EMAIL PROTECTED] writes: Rob, I would be logging into another XP machine to do some software I was afraid of that. :) installation... the code you provided, correct me if I'm wrong, seems to work under Unix/Linux. This part of running and killing processes, yes. Any idea how to

draw like windows performance Graph

2007-03-24 Thread momobear
Type the taskmgr, Windows performance Graph give a really nice dynamic history curve, It will be wonderful If I could use the same kind of graph to represent the network flow in my python program. Is there a windows api for this graph drawing? --

Re: Join strings - very simple Q.

2007-03-24 Thread Duncan Booth
Dustan [EMAIL PROTECTED] wrote: Perhaps you're doing it wrong, despite having an example right in front of you? Side by side comparison: jl=string.join(l,',') jl=','.join(l) The sequence is passed as an argument to the join method, and the delimiter is the string whose method is being

Re: creating jsp-like tool with python

2007-03-24 Thread irstas
jd wrote: I'd like to create a program that takes files with jsp-like markup and processes the embedded code (which would be python) to produce the output file. There would be two kinds of sections in the markup file: python code to be evaluated, and python code that returns a value that

Re: Join strings - very simple Q.

2007-03-24 Thread Paulo da Silva
John Machin escreveu: .. Python 2.2.3 (#42, May 30 2003, 18:12:08) [MSC 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. | help(.join) Help on built-in function join: join(...) S.join(sequence) - string Return a string which is the

Re: Join strings - very simple Q.

2007-03-24 Thread Paulo da Silva
Dustan escreveu: On Mar 23, 1:30 pm, Paulo da Silva [EMAIL PROTECTED] wrote: Mike Kent escreveu: ... New way: l=['a','b','c'] jl=','.join(l) I thank you all. Almost there ... I tried .join(l,',') but no success ... :-( Paulo Perhaps you're doing it wrong, despite having an example

Re: Idiom for running compiled python scripts?

2007-03-24 Thread irstas
On Mar 23, 9:30 am, Mark [EMAIL PROTECTED] wrote: A small script called python_compile_and_run in pseudo code: #!/usr/bin/env python import sys # Following is invalid syntax unfortunately :( from sys.argv[1].rstrip('.py') import main sys.argv = sys.argv[1:] if __name__ == __main__:

Re: Join strings - very simple Q.

2007-03-24 Thread Paulo da Silva
Steven D'Aprano escreveu: On Fri, 23 Mar 2007 13:15:29 -0700, John Machin wrote: Western civilization is 6,000 years old. After reading that post I wouldn't talk about civilization, western or any other :-) Regards. Paulo -- http://mail.python.org/mailman/listinfo/python-list

Re: [JOB] Sr. Python Developer, Northern VA

2007-03-24 Thread John J. Lee
Chuck Rhode [EMAIL PROTECTED] writes: John J. Lee wrote this on Thu, 22 Mar 2007 21:16:13 +. My reply is below. I sympathise but conventional wisdom (which surely has a lot of truth in it) is that employers are not faced with the problem of minimising false negatives (failing to

Re: [JOB] Sr. Python Developer, Northern VA

2007-03-24 Thread John J. Lee
Anton Vredegoor [EMAIL PROTECTED] writes: John J. Lee wrote: [...] but I'm sure you appreciate the point -- if you're hiring employees, being fairly risk-averse is probably quite rational. So when we really mean business, you're back to static typing? I'm not wedded to dynamic typing, as

Problem with game

2007-03-24 Thread hollandlucas
Hello, the following script (it's in German): import random print Wie oft wollen Sie spielen? anzahl_spiele = input() games = 0 while games anzahl_spiele: games += 1 print Raten sie die Zahl, die vom Computer generiert wird! random_number = random.randint(1, 100)

Re: Problem with game

2007-03-24 Thread hollandlucas
File Python-episode12-Zahlenraten.py, line 15 print Die eingegebene Zahl ist kleiner als die generierte Zahl. IndentationError: expected an indented block -- http://mail.python.org/mailman/listinfo/python-list

Re: fine grain logging cotrol

2007-03-24 Thread Eric S. Johansson
Dennis Lee Bieber wrote: On Fri, 23 Mar 2007 21:15:56 -0400, Eric S. Johansson [EMAIL PROTECTED] declaimed the following in comp.lang.python: Gabriel Genellina wrote: I don't get all the details of what's all that stuff for, but from the error and traceback, I think you forgot to create

Re: Problem with game

2007-03-24 Thread irstas
On Mar 24, 5:20 pm, [EMAIL PROTECTED] wrote: File Python-episode12-Zahlenraten.py, line 15 print Die eingegebene Zahl ist kleiner als die generierte Zahl. IndentationError: expected an indented block You should indent stuff inside if-statement deeper than the if itself. I.e. NOT LIKE

Re: PyImport_ImportModule/embedding: surprising behaviors

2007-03-24 Thread Aahz
In article [EMAIL PROTECTED], David Abrahams [EMAIL PROTECTED] wrote: I was under the impression that both the current directory *and* the python library directory were already, automatically, in sys.path, so I'm really surprised to see this. Am I doing something wrong, or is this simply the

Pattern for foo tool - API - shell|GUI

2007-03-24 Thread Anastasios Hatzis
I'm looking for a pattern where different client implementations can use the same commands of some fictive tool (foo) by accessing some kind of API. Actually I have the need for such pattern for my own tool (http://openswarm.sourceforge.net). I already started restructuring my code to separate

Re: PyImport_ImportModule/embedding: surprising behaviors

2007-03-24 Thread Alex Martelli
Aahz [EMAIL PROTECTED] wrote: In article [EMAIL PROTECTED], David Abrahams [EMAIL PROTECTED] wrote: I was under the impression that both the current directory *and* the python library directory were already, automatically, in sys.path, so I'm really surprised to see this. Am I doing

Re: Join strings - very simple Q.

2007-03-24 Thread Dustan
On Mar 24, 7:16 am, Paulo da Silva [EMAIL PROTECTED] wrote: Dustan escreveu: On Mar 23, 1:30 pm, Paulo da Silva [EMAIL PROTECTED] wrote: Mike Kent escreveu: ... New way: l=['a','b','c'] jl=','.join(l) I thank you all. Almost there ... I tried .join(l,',') but no success ...

Re: Mastering Python

2007-03-24 Thread cga2000
On Sun, Mar 18, 2007 at 09:38:52PM EST, Paul McGuire wrote: On Mar 16, 9:27 am, BartlebyScrivener [EMAIL PROTECTED] wrote: On Mar 16, 8:39 am, Paul McGuire [EMAIL PROTECTED] wrote: Wow, are you still reading? Quit wasting time and go download a Python dist and get started already!

Re: Need help to learn Python

2007-03-24 Thread wesley chun
From: [EMAIL PROTECTED] Date: 23 Mar 2007 06:20:15 -0700 Core Python Programming is mostly theory and very little code. It's good for reference and digging deeper into the language... let me clarify here that mike's statement refers to the total number of large applications in the book.

Removing Python 2.4.4 on OSX

2007-03-24 Thread Robert Hicks
I want to upgrade to 2.5 but I don't see any unistall instructions anywhere. Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Join strings - very simple Q.

2007-03-24 Thread 7stud
On Mar 24, 8:30 am, Duncan Booth [EMAIL PROTECTED] wrote: In case you are feeling that the ','.join(l) looks a bit jarring, be aware that there are alternative ways to write it. You can call the method on the class rather than the instance: jl = str.join(',', l) jl =

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread kyosohma
On Mar 24, 11:30 am, Robert Hicks [EMAIL PROTECTED] wrote: I want to upgrade to 2.5 but I don't see any unistall instructions anywhere. Robert Windows allows us to uninstall it. I think the only thing it really installs is the files, and then it sets the system path, so just delete the files

Re: Pattern for foo tool - API - shell|GUI

2007-03-24 Thread kyosohma
On Mar 24, 10:31 am, Anastasios Hatzis [EMAIL PROTECTED] wrote: I'm looking for a pattern where different client implementations can use the same commands of some fictive tool (foo) by accessing some kind of API. Actually I have the need for such pattern for my own tool

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread 7stud
Hi, Robert Hicks wrote: I want to upgrade to 2.5 but I don't see any unistall instructions anywhere. Robert I don't know if this is pertinent to your situation, but yesterday I read something that said you need a framework install in order to do GUI programming with wxPython. I believe a

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread 7stud
Robert Hicks wrote: ... but I don't see any unistall instructions anywhere. Did 2.4.4 come pre-installed? -- http://mail.python.org/mailman/listinfo/python-list

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread Greg Donald
On 24 Mar 2007 10:30:28 -0700, Robert Hicks [EMAIL PROTECTED] wrote: I want to upgrade to 2.5 but I don't see any unistall instructions anywhere. You're not required to remove the old version before installing the new version. Just install the new version somewhere like /usr/local and put

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread Diez B. Roggisch
Robert Hicks schrieb: I want to upgrade to 2.5 but I don't see any unistall instructions anywhere. Don't do it. OSX uses the shipped version for its own purposes, and you'll break things if you uninstall it. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Join strings - very simple Q.

2007-03-24 Thread Diez B. Roggisch
7stud schrieb: On Mar 24, 8:30 am, Duncan Booth [EMAIL PROTECTED] wrote: In case you are feeling that the ','.join(l) looks a bit jarring, be aware that there are alternative ways to write it. You can call the method on the class rather than the instance: jl = str.join(',', l) jl =

Re: Join strings - very simple Q.

2007-03-24 Thread Duncan Booth
Diez B. Roggisch [EMAIL PROTECTED] wrote: 7stud schrieb: When I try the latter example, I get an error: lst = [hello, world] print unicode.join(u\u00d7, lst) Traceback (most recent call last): File test1.py, line 2, in ? print unicode.join(u\u00d7, lst) UnicodeEncodeError:

A better webpage filter

2007-03-24 Thread Anton Vredegoor
Since a few days I've been experimenting with a construct that enables me to send the sourcecode of the web page I'm reading through a Python script and then into a new tab in Mozilla. The new tab is automatically opened so the process feels very natural, although there's a lot of reading,

Re: Join strings - very simple Q.

2007-03-24 Thread Max Erickson
7stud [EMAIL PROTECTED] wrote: On Mar 24, 8:30 am, Duncan Booth [EMAIL PROTECTED] wrote: In case you are feeling that the ','.join(l) looks a bit jarring, be aware that there are alternative ways to write it. You can call the method on the class rather than the instance: jl =

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread Robert Hicks
On Mar 24, 2:09 pm, Greg Donald [EMAIL PROTECTED] wrote: On 24 Mar 2007 10:30:28 -0700, Robert Hicks [EMAIL PROTECTED] wrote: I want to upgrade to 2.5 but I don't see any unistall instructions anywhere. You're not required to remove the old version before installing the new version.

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread Robert Hicks
On Mar 24, 2:06 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: Robert Hicks schrieb: I want to upgrade to 2.5 but I don't see any unistall instructions anywhere. Don't do it. OSX uses the shipped version for its own purposes, and you'll break things if you uninstall it. Diez No, the OSX

Anyone know of a MICR parser algorithm written in Python?

2007-03-24 Thread mkppk
MICR = The line of digits printed using magnetic ink at the bottom of a check. Does anyone know of a Python function that has been written to parse a line of MICR data? Or, some financial package that may contain such a thing? Or, in general, where I should be looking when looking for a piece of

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread 7stud
On Mar 24, 12:09 pm, Greg Donald [EMAIL PROTECTED] wrote: On 24 Mar 2007 10:30:28 -0700, Robert Hicks [EMAIL PROTECTED] wrote: I want to upgrade to 2.5 but I don't see any unistall instructions anywhere. You're not required to remove the old version before installing the new version.

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread Greg Donald
On 24 Mar 2007 12:10:12 -0700, 7stud [EMAIL PROTECTED] wrote: Can you explain how that works? If you install python in /usr/local, doesn't that leave you with something like /usr/local/python? So what does putting usr/local/bin ahead of your other paths do? ./configure --prefix=/usr/local

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread skip
bbxx789 Can you explain how that works? If you install python in bbxx789 /usr/local, doesn't that leave you with something like bbxx789 /usr/local/python? So what does putting usr/local/bin ahead of bbxx789 your other paths do? When you install with --prefix==/usr/local you

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread Shane Geiger
You don't have to uninstall 2.4.4 to use 2.5. Just change where the symlink points: [EMAIL PROTECTED]:~\ 14:45:35$ ls -la /usr/bin/python lrwxr-xr-x 1 root wheel 24 Mar 1 12:48 /usr/bin/python - /usr/local/bin/python2.5 [EMAIL PROTECTED]:~\ 14:45:40$ In general, I am a little wary of

Re: Python object overhead?

2007-03-24 Thread 7stud
On Mar 23, 4:04 pm, Jack Diederich [EMAIL PROTECTED] wrote: If you make the record a new style class (inherit from object) you can specify the __slots__ attribute on the class. This eliminates the per instance dictionary overhead in exchange for less flexibility. How is efficiency improved

Re: Python object overhead?

2007-03-24 Thread Jean-Paul Calderone
On 24 Mar 2007 13:08:02 -0700, 7stud [EMAIL PROTECTED] wrote: On Mar 23, 4:04 pm, Jack Diederich [EMAIL PROTECTED] wrote: If you make the record a new style class (inherit from object) you can specify the __slots__ attribute on the class. This eliminates the per instance dictionary overhead

Re: PyImport_ImportModule/embedding: surprising behaviors

2007-03-24 Thread Ziga Seilnacht
David Abrahams wrote: I'm seeing highly surprising (and different!) behaviors of PyImport_ImportModule on Linux and Windows when used in a program with python embedding. On Linux, when attempting to import a module xxx that's in the current directory, I get ImportError: No module named

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread James Stroud
Shane Geiger wrote: You don't have to uninstall 2.4.4 to use 2.5. Just change where the symlink points: [EMAIL PROTECTED]:~\ 14:45:35$ ls -la /usr/bin/python lrwxr-xr-x 1 root wheel 24 Mar 1 12:48 /usr/bin/python - /usr/local/bin/python2.5 [EMAIL PROTECTED]:~\ 14:45:40$ I have

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread James Stroud
7stud wrote: On Mar 24, 12:09 pm, Greg Donald [EMAIL PROTECTED] wrote: On 24 Mar 2007 10:30:28 -0700, Robert Hicks [EMAIL PROTECTED] wrote: I want to upgrade to 2.5 but I don't see any unistall instructions anywhere. You're not required to remove the old version before installing the new

Re: fine grain logging cotrol

2007-03-24 Thread Eric S. Johansson
Dennis Lee Bieber wrote: On Sat, 24 Mar 2007 11:29:34 -0400, Eric S. Johansson [EMAIL PROTECTED] declaimed the following in comp.lang.python: yes. here is the code that fails. I don't understand why the unbound method. what is really weird is that when I singlestep through the code,

Re: Python object overhead?

2007-03-24 Thread 7stud
On Mar 24, 2:19 pm, Jean-Paul Calderone [EMAIL PROTECTED] wrote: Only one list is created. It is used to define a C array where attributes will be stored. Each instance still has that C array, but it has much less overhead than a Python list or dictionary. It's all C underneath, right? So

Re: Python object overhead?

2007-03-24 Thread Jean-Paul Calderone
On 24 Mar 2007 13:52:46 -0700, 7stud [EMAIL PROTECTED] wrote: On Mar 24, 2:19 pm, Jean-Paul Calderone [EMAIL PROTECTED] wrote: Only one list is created. It is used to define a C array where attributes will be stored. Each instance still has that C array, but it has much less overhead than a

Re: Python object overhead?

2007-03-24 Thread Felipe Almeida Lessa
On 3/23/07, Bjoern Schliessmann [EMAIL PROTECTED] wrote: (Note that almost everything in Python is an object!) Could you tell me what in Python isn't an object? Are you counting old-style classes and instances as not objects? -- Felipe. -- http://mail.python.org/mailman/listinfo/python-list

Re: A better webpage filter

2007-03-24 Thread Gabriel Genellina
En Sat, 24 Mar 2007 15:45:41 -0300, Anton Vredegoor [EMAIL PROTECTED] escribió: Since a few days I've been experimenting with a construct that enables me to send the sourcecode of the web page I'm reading through a Python script and then into a new tab in Mozilla. The new tab is

Re: Join strings - very simple Q.

2007-03-24 Thread John Machin
On Mar 25, 12:32 am, Paulo da Silva [EMAIL PROTECTED] wrote: John Machin escreveu: .. Python 2.2.3 (#42, May 30 2003, 18:12:08) [MSC 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. | help(.join) Help on built-in function join: join(...)

Re: Python object overhead?

2007-03-24 Thread Gabriel Genellina
En Sat, 24 Mar 2007 18:07:57 -0300, Felipe Almeida Lessa [EMAIL PROTECTED] escribió: On 3/23/07, Bjoern Schliessmann [EMAIL PROTECTED] wrote: (Note that almost everything in Python is an object!) Could you tell me what in Python isn't an object? Are you counting old-style classes and

qt ver. 3, linux, windows, and modal forms

2007-03-24 Thread Mike
Hi, I'm having a problem with modal forms on windows. I've written a very short test program, with a main window and a form called from the main window. The form is set to modal with form.setModal(1) before calling form.show(). All works as expected on Linux. The form is modal, not allowing

bugs.python.org has been compromised (urgent)

2007-03-24 Thread John Bokma
Just got comment spam in: http:// bugs.py thon.org/file7722/order-cialis.html http:// bugs.py thon.org/file7722/order-cialis.html order cialis http:// bugs.py thon.org/file7723/order-tramadol.html order tramadol Seems someone found a nice hole in python.org and someone should be severely

Re: Anyone know of a MICR parser algorithm written in Python?

2007-03-24 Thread Paul McGuire
On Mar 24, 2:05 pm, mkppk [EMAIL PROTECTED] wrote: MICR = The line of digits printed using magnetic ink at the bottom of a check. Does anyone know of a Python function that has been written to parse a line of MICR data? Or, some financial package that may contain such a thing? Or, in

Re: Idiom for running compiled python scripts?

2007-03-24 Thread Mark
On Sat, 24 Mar 2007 07:21:21 -0700, irstas wrote: Also, rstrip doesn't work like you think it does. 'pyxyypp.py'.rstrip('.py') == 'pyx' Well there is embarrassing confirmation that I am a python newbie :( I timed it against running plain .py and running .pyc directly. It seemed to be roughly

Re: A better webpage filter

2007-03-24 Thread Anton Vredegoor
Gabriel Genellina wrote: I use the Opera browser: http://www.opera.com Among other things (like having tabs for ages!): - enable/disable tables and divs (like you do) - enable/disable images with a keystroke, or only show cached images. - enable/disable CSS - banner supressing (aggressive)

Re: fine grain logging cotrol

2007-03-24 Thread Eric S. Johansson
Dennis Lee Bieber wrote: I've never resorted to the debugger -- it's always been faster for me to just wolf-fence* code with print statements... depends on the situation for me. normally I use log statements that turn on or off based on predicates (now I need to figure out how to

Re: qt ver. 3, linux, windows, and modal forms

2007-03-24 Thread David Boddie
On Saturday 24 March 2007 23:08, Mike wrote: I'm having a problem with modal forms on windows. I've written a very short test program, with a main window and a form called from the main window. The form is set to modal with form.setModal(1) before calling form.show(). Is form an instance of

Re: Pattern for foo tool - API - shell|GUI

2007-03-24 Thread Anastasios Hatzis
On Saturday 24 March 2007 18:55, [EMAIL PROTECTED] wrote: On Mar 24, 10:31 am, Anastasios Hatzis [EMAIL PROTECTED] wrote: I'm looking for a pattern where different client implementations can use the same commands of some fictive tool (foo) by accessing some kind of API. Actually I have the

Re: bugs.python.org has been compromised (urgent)

2007-03-24 Thread skip
John Just got comment spam in: John http:// bugs.py thon.org/file7722/order-cialis.html John http:// bugs.py thon.org/file7722/order-cialis.html order cialis John http:// bugs.py thon.org/file7723/order-tramadol.html order tramadol Yes, we know about it and are working on

persistent plot windows

2007-03-24 Thread Rodrigo Lopez-Negrete
Hi all, I'm trying to write a python script using plotting form pylab. Unfortunatelly I've encountered a problem. When I run the script via 'python myscript.py' the plot windows open and close very quickly, or when I added the show() command the shell window was locked until I closed the figures.

Re: Idiom for running compiled python scripts?

2007-03-24 Thread Mark
On Sat, 24 Mar 2007 07:21:21 -0700, irstas wrote: A simple implementation that works: Not quite irstas BTW .. import imp, sys, os c = sys.argv[1] if not os.path.exists(c + 'c') or os.stat(c).st_mtime os.stat(c + 'c').st_mtime: import compiler compiler.compileFile(c) del

Step value and function

2007-03-24 Thread [EMAIL PROTECTED]
Hi there. So I have a challenge in the Python book I am using (python programming for the absolute beginner) that tells me to improve a function, so that it can be called with a step value, and I havn't been able to find out yet what's meant by a step value, but i'll keep looking of course. I'd

question about C extensions

2007-03-24 Thread Ralph Butler
Hi: I have a question about extending python with C. I have read the docs and done some googling, but come up short on this particular (small) problem. I want to write a c extension to int. In particular, I want to grab the memory for the int from an alternative heap. I am confused about

Re: Anyone know of a MICR parser algorithm written in Python?

2007-03-24 Thread mkppk
On Mar 24, 4:55 pm, Paul McGuire [EMAIL PROTECTED] wrote: On Mar 24, 2:05 pm, mkppk [EMAIL PROTECTED] wrote: MICR = The line of digits printed using magnetic ink at the bottom of a check. Does anyone know of a Python function that has been written to parse a line of MICR data? Or,

Re: qt ver. 3, linux, windows, and modal forms

2007-03-24 Thread Mike
Answers interspersed. David Boddie wrote: On Saturday 24 March 2007 23:08, Mike wrote: I'm having a problem with modal forms on windows. I've written a very short test program, with a main window and a form called from the main window. The form is set to modal with form.setModal(1) before

Python Game Programming Challenge #4 -- theme voting has started!

2007-03-24 Thread Richard Jones
The next PyWeek game programming challenge starts next Sunday at 00:00UTC. If you're interested, there's definitely still time to sign up to the challenge. http://www.pyweek.org/ Theme voting has started. You may now log into (or sign up to ;) the PyWeek website to lodge your vote for theme.

Re: Step value and function

2007-03-24 Thread James Stroud
[EMAIL PROTECTED] wrote: Hi there. So I have a challenge in the Python book I am using (python programming for the absolute beginner) that tells me to improve a function, so that it can be called with a step value, and I havn't been able to find out yet what's meant by a step value, but i'll

Re: persistent plot windows

2007-03-24 Thread James Stroud
Rodrigo Lopez-Negrete wrote: Hi all, I'm trying to write a python script using plotting form pylab. Unfortunatelly I've encountered a problem. When I run the script via 'python myscript.py' the plot windows open and close very quickly, or when I added the show() command the shell window was

Re: persistent plot windows

2007-03-24 Thread Rodrigo Lopez-Negrete
Hi James, Thanks for the answer, the ampersand only works if I use the show() command at the end of my script. I guess that helps although I haven't tested it with plotting subroutines. cheers, Rodrigo On Mar 24, 6:50 pm, James Stroud [EMAIL PROTECTED] wrote: Rodrigo Lopez-Negrete wrote:

Re: Idiom for running compiled python scripts?

2007-03-24 Thread Gabriel Genellina
En Sat, 24 Mar 2007 20:46:15 -0300, Mark [EMAIL PROTECTED] escribió: The above doesn't actually work for my test script. I have an atexit call in the script which is deleting some temp files and I get the following traceback on termination when run with the above: Error in

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread Michael Bentley
On Mar 24, 2007, at 12:30 PM, Robert Hicks wrote: I want to upgrade to 2.5 but I don't see any unistall instructions anywhere. Don't uninstall it. That's why Apple put python under /Library/Frameworks/ Python.framework/Versions. So you can have multiple versions installed. Hopefully you

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread Michael Bentley
On Mar 24, 2007, at 12:55 PM, 7stud wrote: In addition, the download notes for the stand alone MacPython 2.5 install say that there aren't as many modules for 2.5 as there are for the 2.4, which is something you may want to consider. There aren't as many pre-built modules for 2.5 at the

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread Michael Bentley
No, the OSX version is like 2.3 something. I installed the 2.4.4 version in /usr/local bypassing the Apple stuff. Oh! Well then: ---[cut here]--- # danger will robinson -- use at your own risk ;-) rm /usr/local/bin/python* rm -rf /usr/local/lib/python ---[snip]--- Is the uninstall program

functions, classes, bound, unbound?

2007-03-24 Thread 7stud
Here is some example code that produces an error: class Test(object): def greet(): print Hello t = Test() t.greet() TypeError: greet() takes no arguments (1 given) Ok. That makes sense. t.greet() is a bound method, so something automatically relays the instance object

Re: functions, classes, bound, unbound?

2007-03-24 Thread Felipe Almeida Lessa
On 24 Mar 2007 20:24:36 -0700, 7stud [EMAIL PROTECTED] wrote: Here is some example code that produces an error: [snip] Why do people absolutely *love* to do weird and ugly things with Python? Contests apart, I don't see lots of people trying this kind of things on other (common) languages. Say

Re: Idiom for running compiled python scripts?

2007-03-24 Thread Steven D'Aprano
On Sat, 24 Mar 2007 22:59:06 +, Mark wrote: I timed it against running plain .py and running .pyc directly. It seemed to be roughly on par with running .pyc directly, and about 18ms faster than running .py. The file had 600 lines (21kb) of code. So see my point at least? I'm still not

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread 7stud
On Mar 24, 8:18 pm, Michael Bentley [EMAIL PROTECTED] wrote: On Mar 24, 2007, at 12:30 PM, Robert Hicks wrote: I want to upgrade to 2.5 but I don't see any unistall instructions anywhere. Don't uninstall it. That's why Apple put python under /Library/Frameworks/

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread 7stud
On Mar 24, 9:40 pm, 7stud [EMAIL PROTECTED] wrote: On Mar 24, 8:18 pm, Michael Bentley [EMAIL PROTECTED] wrote: On Mar 24, 2007, at 12:30 PM, Robert Hicks wrote: I want to upgrade to 2.5 but I don't see any unistall instructions anywhere. Don't uninstall it. That's why Apple put

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread js
The only way you can do is rermove python2.4.4's files manually. I suggest you to use MacPorts or Fink. With MacPort, you can uninstall python2.4 by doing $ port uninstall python24 And Installation is $ port install python25 On 24 Mar 2007 10:30:28 -0700, Robert Hicks [EMAIL PROTECTED]

Re: functions, classes, bound, unbound?

2007-03-24 Thread Steven D'Aprano
On Sat, 24 Mar 2007 20:24:36 -0700, 7stud wrote: Here is some example code that produces an error: class Test(object): def greet(): print Hello t = Test() t.greet() TypeError: greet() takes no arguments (1 given) Ok. That makes sense. t.greet() is a bound

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread Alex Martelli
7stud [EMAIL PROTECTED] wrote: On Mar 24, 9:40 pm, 7stud [EMAIL PROTECTED] wrote: On Mar 24, 8:18 pm, Michael Bentley [EMAIL PROTECTED] wrote: On Mar 24, 2007, at 12:30 PM, Robert Hicks wrote: I want to upgrade to 2.5 but I don't see any unistall instructions anywhere.

Using remote source code

2007-03-24 Thread pyapplico
Is there any possible way that I can place a .py file on the internet, and use that source code in an .py file on my computer? -- http://mail.python.org/mailman/listinfo/python-list

Re: functions, classes, bound, unbound?

2007-03-24 Thread Steven Bethard
7stud wrote: Here is some example code that produces an error: class Test(object): def greet(): print Hello t = Test() t.greet() TypeError: greet() takes no arguments (1 given) [snip] Test.greet() TypeError: unbound method greet() must be called with Test

Re: question about C extensions

2007-03-24 Thread Ralph Butler
I think I may have figured all this out by looking at examples in the python source, e.g. xxsubtype.c etc. Nonetheless, I would appreciate any extra info others might provide. Thanks again. --ralph Ralph Butler wrote: Hi: I have a question about extending python with C. I have read the docs

  1   2   >