Re: round function problem

2005-09-06 Thread Bengt Richter
On Tue, 06 Sep 2005 09:27:48 +0200, mg <[EMAIL PROTECTED]> wrote: >Hi everybody... > >We try to white scripts with Pyrhon 2.4 for an acoustic simulation and >we wrote these follow lines : > > >c = 340 340 is an integer, which is different from 340. >i =j=k= 1 >sum_ = 23 also an integer >table = [

Re: Replacement for lambda - 'def' as an expression?

2005-09-06 Thread Simo Melenius
Paul Rubin writes: > Sybren Stuvel <[EMAIL PROTECTED]> writes: > > An example: > > > > def generate_randomizer(n, m): > > randomizer = def(x): > > return x ** n % m > > > > return randomizer > > You're a little bit confused; "name" doesn't necessarily

Re: Ode to python

2005-09-06 Thread Gregory Bond
Hmmm... OK... you forced me into it. Python uses whitespace Where C++ uses a brace New users fret, But old pros forget - it quickly all falls into place. I could go on.. -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe uses __init__ for class names when logging

2005-09-06 Thread flupke
Thomas Heller wrote: > This has been discussed on the py2exe-users lists, and a fix was found > by David Hess. Fortunately he added it to the wiki: > > http://starship.python.net/crew/theller/moin.cgi/LoggingModule > > Thomas Cool, thanks Thomas, i'll give that a whirl Benedict -- http://ma

Re: py2exe 0.6.1 released

2005-09-06 Thread Bengt Richter
On Tue, 06 Sep 2005 11:12:46 +0200, Thomas Heller <[EMAIL PROTECTED]> wrote: >"Giovanni Bajo" <[EMAIL PROTECTED]> writes: > >> Thomas Heller wrote: >> >>> * py2exe can now bundle binary extensions and dlls into the >>> library-archive or the executable itself. This allows to >>> f

Re: os.system(r"ls") prints to screen??

2005-09-06 Thread Xah Lee
Xah Lee wrote: > does anyone know why the folllowing prints to the screen? > # python > import os > os.system(r"ls") Steve Holden wrote: > It only prints to the screen when standard output of the invoking > process is the screen. The sub-process forked by os.system inherits > stdin stdout and stde

Re: Possible improvement to slice opperations.

2005-09-06 Thread Bengt Richter
On Tue, 06 Sep 2005 18:34:13 +0200, Magnus Lycka <[EMAIL PROTECTED]> wrote: [...] > >Then you need to view it more in the mathematical way of >half-open (or half-closed if you prefer) intervals. > >[a,b) = { x | a <= x < b } > Funny, I just posted with the same thought (and some additional consider

Re: Possible improvement to slice opperations.

2005-09-06 Thread Bengt Richter
On Tue, 06 Sep 2005 10:31:33 GMT, Ron Adam <[EMAIL PROTECTED]> wrote: >Steve Holden wrote: [...] > >> My point was that you can make those changes in your own code, leaving >> others to accept the situation as it is. > >It's only a suggestion and an interesting idea I thought I would share >and s

Re: Do int.__lt__/__gt__/etc. exist?

2005-09-06 Thread Terry Reedy
"Chris Dutton" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm just curious. I've been trying to demonstrate functional thinking > in Python, but I can't find these methods for int objects. It would be > immensely helpful for something like: > > filter(4 .__lt__, range(10)) D

Re: Language Work Benches in Py

2005-09-06 Thread yoda
I realize that I forgot to post the sample code:). Below is my implementation: #DSL data #123456789012345678901234567890123456789012345678901234567890, dsldata=( 'SVCLFOWLER 10101MS0120050313.', 'SVCLHOHPE 10201DX0320050315', 'SVCLT

Re: assign dict by value to list

2005-09-06 Thread Terry Reedy
"Phill Atwood" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > def csv_it(): > db = [] # the entire database of records > rec = {} # a single rec: a dictionary of field names and data pairs Move this line > fields = [] # list of field names collected so far for curren

Re: Ode to python

2005-09-06 Thread [EMAIL PROTECTED]
Python the programming language is reviled for its indentage. Although it's the norm, to code in free form makes sources no better than garbage. -- http://mail.python.org/mailman/listinfo/python-list

Re: [Jython-users] ANN: PyDev 0.9.8.1 released

2005-09-06 Thread could ildg
Thanks. pydev is so alive.On 9/7/05, Fabio Zadrozny <[EMAIL PROTECTED]> wrote: Hi All,PyDev - Python IDE (Python Development Enviroment for Eclipse) version0.9.8.1 has been released.Check the homepage (http://pydev.sourceforge.net/ ) for more details.Details for Release: 0.9.8.1Major highlights:---

Re: ~ after script filename?

2005-09-06 Thread presentt
Huh, no ~ on other files when I edit them, but at least I don't have to worry about it. Thanks Aldo. -- http://mail.python.org/mailman/listinfo/python-list

Re: Ode to python

2005-09-06 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Python or C? C is simply a pawn. > Venomous problem? Pythons squeeze and constrict, until the problem is > gone. Don't quit your day job. -- http://mail.python.org/mailman/listinfo/python-list

Re: Function returns a function

2005-09-06 Thread Paul Rubin
Aldo Cortesi <[EMAIL PROTECTED]> writes: > The lexical scope within which a function is declared is > made available to the function when it is run. This is done > by storing the values of free variables within the declared > function in the func_closure attribute of the created > function object.

Re: ~ after script filename?

2005-09-06 Thread Aldo Cortesi
Thus spake presentt ([EMAIL PROTECTED]): > Hello all, > > I just wrote a really simple script and named it > helloworld.py. Inside was only: > > #!/usr/bin/env print "Hello, world" > > I used chmod to set the permissions, and ran it to see > what happened (I just started learning Python, if you

Re: Function returns a function

2005-09-06 Thread Aldo Cortesi
Thus spake Gregory Bond ([EMAIL PROTECTED]): > Paul Rubin wrote: > > > > > def FunctionMaker(avar, func, label): > >def callback(): > > avar.set(label) > > func() > >return callback > > I've seen this idiom a lot and I know _what_ it does. > but I can't

~ after script filename?

2005-09-06 Thread presentt
Hello all, I just wrote a really simple script and named it helloworld.py. Inside was only: #!/usr/bin/env print "Hello, world" I used chmod to set the permissions, and ran it to see what happened (I just started learning Python, if you couldn't guess) Then, I typed ls in the directory to see

Re: Python executable

2005-09-06 Thread presentt
Thanks everyone! I think I'm going to stick with Python; at least I know there are some people here willing to help. -- http://mail.python.org/mailman/listinfo/python-list

Re: assign dict by value to list

2005-09-06 Thread Steve Holden
Phill Atwood wrote: > Newbie question: > > I have a dictionary called "rec". And a list called "db". db is my > database. rec are to be records in the database. In a loop I'm trying to > create a record and add it to my database. The key stmt is > > db.append( rec ) > > This works initially

Re: Proposal: add sys to __builtins__

2005-09-06 Thread Rick Wotnaz
"Michael J. Fromberger" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > In article <[EMAIL PROTECTED]>, > Rick Wotnaz <[EMAIL PROTECTED]> wrote: > >> You're right that there is no necessity for such a change. I >> was not actually talking about importing *any* module in every >> case, bu

Re: Do int.__lt__/__gt__/etc. exist?

2005-09-06 Thread en.karpachov
On Wed, 07 Sep 2005 00:02:49 GMT Chris Dutton wrote: > I'm just curious. I've been trying to demonstrate functional thinking > in Python, but I can't find these methods for int objects. It would be > immensely helpful for something like: > > filter(4 .__lt__, range(10)) > > As opposed to: >

Ode to python

2005-09-06 Thread liquidbinary
*Organized Chaos* I crafted your purpose one line at a time. No other creation shall be like your kind. Boolean values fire connections. High level logic from your inception. I partitioned your system into functions of selfdom. Artificial neurons thread together to bond them. Not one routine sh

Re: improvements for the logging package

2005-09-06 Thread skip
>> while working on something in my current project I have made several >> improvements to the logging package in Python, two of them are worth >> mentioning: ... Trent> Cool. Your additions sound useful. Perhaps so, but the logging module seems like such an unpythonic beast t

Re: infinite loop

2005-09-06 Thread Mike Meyer
"LOPEZ GARCIA DE LOMANA, ADRIAN" <[EMAIL PROTECTED]> writes: > Hi all, > > I have a question with some code I'm writting: > > > def main(): > if option == 1: > function_a() > elif option == 2: > function_b() > else: > raise 'option has to be either 1 or 2' >

assign dict by value to list

2005-09-06 Thread Phill Atwood
Newbie question: I have a dictionary called "rec". And a list called "db". db is my database. rec are to be records in the database. In a loop I'm trying to create a record and add it to my database. The key stmt is db.append( rec ) This works initially but it seems that instead of copying

Re: Function returns a function

2005-09-06 Thread Gregory Bond
Paul Rubin wrote: > > def FunctionMaker(avar, func, label): >def callback(): > avar.set(label) > func() >return callback I've seen this idiom a lot and I know _what_ it does. but I can't work _how_ it does it. How does the name binding work so that "

Re: Optional algol syntax style

2005-09-06 Thread Mike Meyer
"Christoph Rackwitz" <[EMAIL PROTECTED]> writes: > You didn't quite get the OP's intention, I guess. > > The OP wanted Python to be a bit more freeform by adding "end" tags. > That might be an improvement for web scripting, but I haven't seen the > solutions of the existing frameworks and won't dar

Re: Proposal: add sys to __builtins__

2005-09-06 Thread Patrick Maupin
Sybren Stuvel wrote: > A programming language should not be ambiguous. The choice > between importing a module and calling a function should not > depend on the availability of a (local) variable. Yeah, this behavior would be as ambiguous as if we had a system-defined search-path for modules, whe

Re: dual processor

2005-09-06 Thread Mike Meyer
Jeremy Jones <[EMAIL PROTECTED]> writes: > 1) find a good clean way to utilize muti-CPU machines and I like SCOOP. But I'm still looking for alternatives. > 2) come up with a simple, consistent, Pythonic concurrency paradigm. That's the hard part. SCOOP attaches attributes to *variables*. It als

Re: dual processor

2005-09-06 Thread Mike Meyer
Jorgen Grahn <[EMAIL PROTECTED]> writes: > But it's interesting that the Unix pipeline Just Works (TM) with so little > effort. Yes it is. That's a result of two things: 1) The people who invented pipes were *very* smart (but not smart enough to invent stderr at the same time :-). 2) Pipes us

Re: Proposal: add sys to __builtins__

2005-09-06 Thread Michael J. Fromberger
In article <[EMAIL PROTECTED]>, Rick Wotnaz <[EMAIL PROTECTED]> wrote: > You're right that there is no necessity for such a change. I was > not actually talking about importing *any* module in every case, > but rather about importing, say, 'sys' when, for example, sys.argv > appeared in the co

Re: Python xml.dom, help reading attribute data

2005-09-06 Thread Giovanni Bajo
Thierry Lam wrote: > Let's say I have the following xml tag: > > 1 > > I can't figure out what kind of python xml.dom codes I should invoke > to read the data 1? Any help please? > > Thanks > Thierry If you use elementtree: >>> from elementtree import ElementTree >>> node = ElementTree.fromstri

Re: Last mod date

2005-09-06 Thread Andrew McNamara
>This is my first post--I'm a Java developer trying to expand my >horizons. I'm trying to figure out how to find out the last >modification date/time for a file. I've found a reference to >*PyOS_GetLastModificationTime *as an Operating System Utility, but I >can't figure out which module I ne

Re: Last mod date

2005-09-06 Thread Robert Kern
Webmaster - Fidelity Lodge #113 wrote: > This is my first post--I'm a Java developer trying to expand my > horizons. I'm trying to figure out how to find out the last > modification date/time for a file. I've found a reference to > *PyOS_GetLastModificationTime *as an Operating System Utility,

Last mod date

2005-09-06 Thread Webmaster - Fidelity Lodge #113
This is my first post--I'm a Java developer trying to expand my horizons. I'm trying to figure out how to find out the last modification date/time for a file. I've found a reference to *PyOS_GetLastModificationTime *as an Operating System Utility, but I can't figure out which module I need to

Re: py2exe 0.6.1 released

2005-09-06 Thread Giovanni Bajo
Thomas Heller wrote: >> I tried it using the wx singlefile example, but unfortunately the >> resulting executable segfaults at startup (using Python 2.3.3 on >> Windows 2000, with latest wxWindows). > > Yes, I can reproduce that. I'm still using wxPython 2.4.2.4 for > Python > 2.3.5, and that com

Do int.__lt__/__gt__/etc. exist?

2005-09-06 Thread Chris Dutton
I'm just curious. I've been trying to demonstrate functional thinking in Python, but I can't find these methods for int objects. It would be immensely helpful for something like: filter(4 .__lt__, range(10)) As opposed to: filter(lambda a: 4 < a, range(10)) -- http://mail.python.org/mailman

Re: ANN: PyInstaller 1.0 in the works: package your Python app into asingle-file executable

2005-09-06 Thread Trent Mick
[Giovanni Bajo wrote] > Trent Mick wrote: > > > I notice that the release notes for py2exe 0.6.1 mention that it > > finally *can* make a single file executable. I'm not involved in > > developing it > > nor am I that experienced with it. Just an FYI. > > Yes, I noticed it. You'll have noticed al

Re: ANN: PyInstaller 1.0 in the works: package your Python app into asingle-file executable

2005-09-06 Thread Giovanni Bajo
Trent Mick wrote: > I notice that the release notes for py2exe 0.6.1 mention that it > finally *can* make a single file executable. I'm not involved in > developing it > nor am I that experienced with it. Just an FYI. Yes, I noticed it. You'll have noticed also that the announcement happened afte

Re: Possible improvement to slice opperations.

2005-09-06 Thread Ron Adam
Magnus Lycka wrote: > Ron Adam wrote: > >> Ok, lets see... This shows the problem with using the gap indexing >> model. >> >> L = range(10) >> >> [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ] # elements >> 0 1 2 3 4 5 6 7 8 9 10 # index's >> >> L[3::1] -> [3, 4, 5, 6, 7, 8

Re: dual processor

2005-09-06 Thread Paul Rubin
[EMAIL PROTECTED] (Bengt Richter) writes: > >And I'm fairly certain that 'sort' won't start spending CPU time > >until it has collected all its input, so you won't gain much > >there either. > > > Why wouldn't a large sequence sort be internally broken down into parallel > sub-sequence sorts and me

Re: dual processor

2005-09-06 Thread Bengt Richter
On Tue, 6 Sep 2005 19:35:49 + (UTC), Thomas Bellman <[EMAIL PROTECTED]> wrote: >Michael Sparks <[EMAIL PROTECTED]> writes: > >> Similarly, from >> a unix command line perspective, the following will automatically take >> advantage of all the CPU's I have available: > >>(find |while read i

Re: infinite loop

2005-09-06 Thread James
Devan L wrote: > LOPEZ GARCIA DE LOMANA, ADRIAN wrote: > > Hi all, > > > > I have a question with some code I'm writting: > > > > > > def main(): > > > > if option == 1: > > > > function_a() > > > > elif option == 2: > > > > function_b() > > > > else: > > > > rai

Re: infinite loop

2005-09-06 Thread Scott David Daniels
LOPEZ GARCIA DE LOMANA, ADRIAN wrote: > Hi all, > > I have a question with some code I'm writting: > > > def main(): > if option == 1: > function_a() > elif option == 2: > function_b() > else: > raise 'option has to be either 1 or 2' > if iteration == Tru

Re: infinite loop

2005-09-06 Thread Devan L
LOPEZ GARCIA DE LOMANA, ADRIAN wrote: > Hi all, > > I have a question with some code I'm writting: > > > def main(): > > if option == 1: > > function_a() > > elif option == 2: > > function_b() > > else: > > raise 'option has to be either 1 or 2' > > if itera

infinite loop

2005-09-06 Thread LOPEZ GARCIA DE LOMANA, ADRIAN
Hi all, I have a question with some code I'm writting: def main(): if option == 1: function_a() elif option == 2: function_b() else: raise 'option has to be either 1 or 2' if iteration == True: main() def function_a(): print 'hello

Re: Possible improvement to slice opperations.

2005-09-06 Thread Ron Adam
Patrick Maupin wrote: > Ron Adam wrote: > > >>>This should never fail with an assertion error. You will note that it >>>shows that, for non-negative start and end values, slicing behavior is >>>_exactly_ like extended range behavior. > > >>Yes, and it passes for negative start and end values a

Re: __dict__ of object, Was: Regular Expression IGNORECASE differentfor findall and split?

2005-09-06 Thread Fredrik Lundh
Chris <[EMAIL PROTECTED]> wrote: > but more of a basic question following, I was doing the following before: > > method = 'split' # came from somewhere else of course > result = re.__dict__[method].(REGEX, TXT) > > precompiling the regex > > r = compile(REGEX) > > does give an regex object which h

attn: carline - very colorful premium news server access - vifne col - (1/1)

2005-09-06 Thread briant
Imagine this, Take a look at all the great features below and imagine! You'll LOVE it. Images, video, mp3 music, the real news from around the world... it's all inside waiting for you. Take a look, I know you'll love it as much as I do. Streaming audio and video Blazing fast downloads 800 GIGS o

Re: Cleaning strings with Regular Expressions

2005-09-06 Thread Fredrik Lundh
"sheffdog" <[EMAIL PROTECTED]> wrote: > Using basename works, but leaves the extra stuff at the end. > Which would have to be removed with another line of code > > I get this--> ppbhat.tga"; if you're trying to parse Maya files, maybe you should start by writing a simple Maya parser, and use

Re: __dict__ of object, Was: Regular Expression IGNORECASE different for findall and split?

2005-09-06 Thread Steven Bethard
Chris wrote: > but more of a basic question following, I was doing the following before: > > method = 'split' # came from somewhere else of course > result = re.__dict__[method].(REGEX, TXT) > > precompiling the regex > > r = compile(REGEX) > > does give an regex object which has th

Re: Function returns a function

2005-09-06 Thread James Stroud
Thank you Paul, this makes much more sense. James On Tuesday 06 September 2005 02:16 pm, Paul Rubin wrote: >     def FunctionMaker(avar, func, label): >        def callback(): >           avar.set(label) >           func() >        return callback -- James Stroud UCLA-DOE Institute for Genomics

Re: Function returns a function

2005-09-06 Thread Paul Rubin
James Stroud <[EMAIL PROTECTED]> writes: > Any ideas on how to do this with a regular function, or is the way I've done > it the pythonic choice? I think you're trying to do something like this: def FunctionMaker(avar, func, label): def callback(): avar.set(label)

Re: Cleaning strings with Regular Expressions

2005-09-06 Thread sheffdog
Using basename works, but leaves the extra stuff at the end. Which would have to be removed with another line of code I get this--> ppbhat.tga"; Thanks, for the idea though. /\/\ason -- http://mail.python.org/mailman/listinfo/python-list

Re: dual processor

2005-09-06 Thread Paul Rubin
Thomas Bellman <[EMAIL PROTECTED]> writes: > And I'm fairly certain that 'sort' won't start spending CPU time > until it has collected all its input, so you won't gain much > there either. For large input, sort uses the obvious in-memory sort, external merge algorithm, so it starts using cpu once

Re: dual processor

2005-09-06 Thread Paul Rubin
Jorgen Grahn <[EMAIL PROTECTED]> writes: > I feel the recent SMP hype (in general, and in Python) is a red herring. Why > do I need that extra performance? What application would use it? How many mhz does the computer you're using right now have? When did you buy it? Did you buy it to replace a

Re: launching adobe reader with arguments from os.system call

2005-09-06 Thread Martin Miller
Greg Miller wrote: > Currently I am launching adobe reader using the following call: > os.system("path.file.pdf") > this works fine for opening the pdf doc at the beginning. We would like > to enhance this and open the document to either a page or a nameddest > in the doc. The syntax for that in t

Re: Cleaning strings with Regular Expressions

2005-09-06 Thread Larry Bates
May not be what you are looking for, but this works: import os s='setAttr ".ftn" -type "string" ' \ '/assets/chars/boya/geo/textures/lod1/ppbhat.tga";' fname=os.path.basename(s.split()[-1]) BTW-It does depend on the file/path being the last item on the line. Larry Bates sheffdog wrote: > He

Re: Replacement for lambda - 'def' as an expression?

2005-09-06 Thread Paul Rubin
"Terry Reedy" <[EMAIL PROTECTED]> writes: > Are you claiming that including a reference to the more humanly readable > representation of a function (its source code) somehow detracts from the > beauty of the function concept? Huh? Anonymous functions mean you can use functions as values by spel

Re: Cleaning strings with Regular Expressions

2005-09-06 Thread Fredrik Lundh
"sheffdog" <[EMAIL PROTECTED]> wrote: > setAttr ".ftn" -type "string" /assets/chars/ >/boya/geo/textures/lod1/ppbhat.tga"; > Can I do this in one line? >>> os.path.basename("/assets/chars/.../lod1/ppbhat.tga") 'ppbhat.tga' -- http://mail.python.org/mailman/listinfo/python-list

__dict__ of object, Was: Regular Expression IGNORECASE different for findall and split?

2005-09-06 Thread Chris
Peter Otten wrote: > Chris wrote: > > >> >>> re.split('x', '1x2X3', re.I) >>['1', '2X3'] > > > >>I expected ['1', '2', '3'] but in this case re.I bahaves exactly as not >>present at all... > > > >>Is that an expected behaviour or a fault? > > > This is expected: > > help(re.split)

Function returns a function

2005-09-06 Thread James Stroud
Hello, I want a "function factory" function in python. To do this I made a class like such (this is for Tkinter, in case your wondering): class FunctionMaker: def __init__(self, avar, function, label) self.var = avar self.function = function self.label = label def __call__(self,

Re: Replacement for lambda - 'def' as an expression?

2005-09-06 Thread Robert Kern
talin at acm dot org wrote: > I like the decorator idea. Unfortunately, the version of Python I am > using is pre-decorator, and there are various issues involved in > upgrading on Mac OS X (due to the built-in Python 2.3 being used by the > OS itself.) I'll have to look into how to upgrade without

Re: Generators and Decorators doing my head in ..

2005-09-06 Thread simonvc
Fantastic, thanks Leif and Paul, My problem is that i thought the decorator worked at the function runtime, not when the function gets created. -- http://mail.python.org/mailman/listinfo/python-list

Cleaning strings with Regular Expressions

2005-09-06 Thread sheffdog
Hello, I often find myself cleaning up strings like the following: setAttr ".ftn" -type "string" /assets/chars/ /boya/geo/textures/lod1/ppbhat.tga"; Using regular expressions, the best I can do so far is using the re.sub command but it still takes two lines. Can I do this in one line? O

Re: Replacement for lambda - 'def' as an expression?

2005-09-06 Thread talin at acm dot org
I like the decorator idea. Unfortunately, the version of Python I am using is pre-decorator, and there are various issues involved in upgrading on Mac OS X (due to the built-in Python 2.3 being used by the OS itself.) I'll have to look into how to upgrade without breaking too much... Some further

Re: simple question: $1, $2 in py ?

2005-09-06 Thread Christos Georgiou
On Mon, 05 Sep 2005 12:54:35 +0200, rumours say that "Diez B. Roggisch" <[EMAIL PROTECTED]> might have written: >> >> As far as I understand there's no $1, $2... etc stuff right ? > >Yes - but there is sys.argv > >Try this > > >import this >print sys.argv I believe this last line should be: p

Re: Proposal: add sys to __builtins__

2005-09-06 Thread Christopher Subich
Michael J. Fromberger wrote: > While I'm mildly uncomfortable with the precedent that would be set by including the contents of "sys" as built-ins, I must confess my objections are primarily aesthetic: I don't want to see the built-in namespace any more cluttered than is necessary -- or at le

Re: killing thread after timeout

2005-09-06 Thread Bryan Olson
Bryan Olson wrote: [Some stuff he thinks is right, but might not answer the real question] Definitely look into Peter Hanson's answer. Olson's answer was about timing-out one's own Python code. Bryan Olson has heretofore avoided referring to himself in the third person, and will hence forth end

Re: Django Vs Rails

2005-09-06 Thread Terry Reedy
"bruno modulix" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >D H wrote: > > (snip) >> Go with Rails. Django is only like a month old. > > Please take time to read the project's page. Django has in fact three > years of existence and is already used on production websites, so it's

Re: Python compiled?

2005-09-06 Thread Christos Georgiou
On Tue, 06 Sep 2005 03:06:52 -, rumours say that Grant Edwards <[EMAIL PROTECTED]> might have written: >There are very, very few pure "exe" >single-file executable windows apps. Putty is the only one >I've run across in a _long_ while. Then you should also run across Media Player Classic (do

Re: Regular Expression IGNORECASE different for findall and split?

2005-09-06 Thread Peter Otten
Chris wrote: > >>> re.split('x', '1x2X3', re.I) > ['1', '2X3'] > I expected ['1', '2', '3'] but in this case re.I bahaves exactly as not > present at all... > Is that an expected behaviour or a fault? This is expected: >>> help(re.split) Help on function split in module sre: split(pattern,

Re: Replacement for lambda - 'def' as an expression?

2005-09-06 Thread Sybren Stuvel
Terry Reedy enlightened us with: > Are you claiming that including a reference to the more humanly readable > representation of a function (its source code) somehow detracts from the > beauty of the function concept? Nope. > Or are you claiming that binding a function to a name rather than > so

Re: killing thread after timeout

2005-09-06 Thread Bryan Olson
Jacek Poplawski had written: >> I am going to write python script which will read python >> command from socket, run it and return some values back to >> socket. >> >> My problem is, that I need some timeout. Jacek Poplawski wrote: > After reading more archive I think that solution may be t

Re: Replacement for lambda - 'def' as an expression?

2005-09-06 Thread Sybren Stuvel
Paul Rubin enlightened us with: > You're a little bit confused; "name" doesn't necessarily mean > "persistent name". Wonderful. Another feature added to Python (that is: the Python version in my mind ;-) without the need to add any features to Python (that is: the real Python) Thanks! Sybren --

Re: Writing Multithreaded Client-Server in Python.

2005-09-06 Thread google
a bit of a late reply, sorry... Paul Rubin schreef: > [EMAIL PROTECTED] writes: > > > I suspect he was trying to say that BaseHTTPServer has no mechanism for > > > handling state. As you know, of course, this is most relevant across > > > multiple successive connections to a server from the same

Re: Ignoring ampersand(&) as a special character in xml

2005-09-06 Thread Chris
Chris wrote: > Thierry Lam wrote: > >> Let's say I have the following xml tag: >> >> a & b >> >> Currently, an xml parser will treat & as a special character. Does >> anyone know the special characters to use around the ampersand so that >> the xml parser can treat "a & b" as a whole value? >> >>

Re: Ignoring ampersand(&) as a special character in xml

2005-09-06 Thread Chris
Thierry Lam wrote: > Let's say I have the following xml tag: > > a & b > > Currently, an xml parser will treat & as a special character. Does > anyone know the special characters to use around the ampersand so that > the xml parser can treat "a & b" as a whole value? > > Thanks > Thierry > Si

Regular Expression IGNORECASE different for findall and split?

2005-09-06 Thread Chris
hello, I have question about the re.I option for Regular Expressions: >>> import re >>> re.findall('x', '1x2X3', re.I) ['x', 'X'] as expected finds both lower and uppercase x >>> re.split('x', '1x2X3', re.I) ['1', '2X3'] >>> re.split('x', '1x2X3') ['1', '2X3'] I expected ['1', '2', '3'] bu

Re: py2exe uses __init__ for class names when logging

2005-09-06 Thread Thomas Heller
flupke <[EMAIL PROTECTED]> writes: > Hi, > > when i run my program and use the logging component, i see this: > > 2005-09-02 17:07:48,193 INFO windowmain 97 Main window created > 2005-09-02 17:07:49,020 DEBUG windowmain 103 Frame proxy of C++ wxFrame instance at _b8dd9401_p_wxFrame> > 2005-09-02

Re: py2exe 0.6.1 released

2005-09-06 Thread Thomas Heller
"cmkl" <[EMAIL PROTECTED]> writes: > Hi, > > I didnt succeed to bundle vpython-3.2.3 with py2exe-0.6.1 - regardless > if its build as single file or not: > > "This application has requested the Runtime to terminate it in an > unusual way" and so on... > > This error message seems not generated by

Ignoring ampersand(&) as a special character in xml

2005-09-06 Thread Thierry Lam
Let's say I have the following xml tag: a & b Currently, an xml parser will treat & as a special character. Does anyone know the special characters to use around the ampersand so that the xml parser can treat "a & b" as a whole value? Thanks Thierry -- http://mail.python.org/mailman/listinfo/

Re: Python versus Perl

2005-09-06 Thread Matthias Kluwe
Hi! > [...] > 1 - How does the speed of execution of Perl compares to that of Python? This might not answer your question, but I found "The Computer Language Shootout Benchmarks" quite interesting (and fun). Python to Perl comparison can be found at http://shootout.alioth.debian.org/benchmark.p

Re: dual processor

2005-09-06 Thread Thomas Bellman
Michael Sparks <[EMAIL PROTECTED]> writes: > Similarly, from > a unix command line perspective, the following will automatically take > advantage of all the CPU's I have available: >(find |while read i; do md5sum $i; done|cut -b-32) 2>/dev/null |sort No, it won't. At the most, it will use f

Re: Replacement for lambda - 'def' as an expression?

2005-09-06 Thread Terry Reedy
"Sybren Stuvel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > talin at acm dot org enlightened us with: >> I'd be sad to see the notion of "anonymous functions" go Though it is as yet unclear as to what may come in compensation. > Same here. I think it's a beautyful concept Are

Re: Python versus Perl

2005-09-06 Thread Michael Ekstrand
I don't have any benchmark/performance data available, so I'll pass on those questions, but I'll take a stab at the third (being reasonably fluent in both languages). On Sep 6, 2005, at 12:03 PM, Dieter Vanderelst wrote: > 3 - In my opinion Python is very well suited for text processing. Does >

Re: which reg values modified my python installer under windows

2005-09-06 Thread Peter Hansen
Philippe C. Martin wrote: > I forgot to mention that I want to do it automatically from my application's > installer. Calling the "assoc" and "ftype" commands is one approach. Try them with the existing settings to see how standard Python sets them up: c:\> assoc .py .py=Python.File c:\> ftype

Re: killing thread after timeout

2005-09-06 Thread Peter Hansen
Jacek Popławski wrote: > I am going to write python script which will read python command from > socket, run it and return some values back to socket. (Sounds like a huge security risk, unless you have tight control over who can connect to that socket.) > My problem is, that I need some timeout

Re: Replacement for lambda - 'def' as an expression?

2005-09-06 Thread Terry Reedy
"talin at acm dot org" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Of course, one can always create a named function. But there are a lot > of cases, such as multimethods / generics and other scenarios where > functions are treated as data, where you have a whole lot of function

Re: Linux to Windows porting question

2005-09-06 Thread Peter Otten
SHELTRAW, DANIEL wrote: > I am trying to port some code to Windows that works fine under Linux. The > offending line is: > > blk = fromstring(f_fid.read(BLOCK_LEN), > num_type).byteswapped().astype(Float32).tostring() > > The error I get is: > > ValueError: string size must be a mul

Re: which reg values modified my python installer under windows

2005-09-06 Thread Philippe C. Martin
Yes Keir, Thanks a lot. Regards; Philippe keirr wrote: > Philippe, > > Windows file associations are in > HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts > > Hope that helps you. > > All the best, > > Keir. -- http://mail.python.org/mailman/listinfo/python

Re: which reg values modified my python installer under windows

2005-09-06 Thread keirr
Philippe, Windows file associations are in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts Hope that helps you. All the best, Keir. -- http://mail.python.org/mailman/listinfo/python-list

Pass pointer from C++ class to Boost Python script ?!!!

2005-09-06 Thread Mavuram, Vishnu (IT)
Hi, Did you get an answer to this posting of yours? What I am trying to do is: struct Sec { ... }; int main(int, char **) { Py_Initialize(); ... Sec *s1 = new Sec(); PyObject *args = Py_BuildValue("(O)", s1); //*** this is where I am having problem ... PyObject* res = PyEval_Call

Re: Pervasive Database Connection

2005-09-06 Thread Neil Hughes
On 6/9/05 08:52, Alex Le Dain wrote: > What is the best way to access a Pervasive database on another machine? Assuming you mean the Pervasive.SQL DBMS... ...depends what you're trying to do and what you're comfortable with. Pervasive can be accessed through various access methods, e.g. low-leve

Linux to Windows porting question

2005-09-06 Thread SHELTRAW, DANIEL
Hello Pyhton Listees I am trying to port some code to Windows that works fine under Linux. The offending line is: blk = fromstring(f_fid.read(BLOCK_LEN), num_type).byteswapped().astype(Float32).tostring() The error I get is: ValueError: string size must be a multiple of element size

Re: killing thread after timeout

2005-09-06 Thread Steve Horsley
Jacek Popławski wrote: > Hello. > > I am going to write python script which will read python command from > socket, run it and return some values back to socket. > > My problem is, that I need some timeout. I need to say for example: > > os.system("someapplication.exe") > > and kill it, if it

Re: execute commands independantly

2005-09-06 Thread Jorgen Grahn
On 6 Sep 2005 08:07:12 -0700, Eric McGraw <[EMAIL PROTECTED]> wrote: > > If you want it to return when the program is finished then use > os.system('app') but if you just want to start it and return right > away, use os.startfile('app') That one is Windows-only, though -- at least in 2.3 where I l

Re: dual processor

2005-09-06 Thread Jorgen Grahn
On Tue, 06 Sep 2005 08:57:14 +0100, Michael Sparks <[EMAIL PROTECTED]> wrote: ... > Are you so sure? I suspect this is due to you being used to writing code > that is designed for a single CPU system. What if you're basic model of > system creation changed to include system composition as well as >

  1   2   >