Re: Wrapping stdout in a codec

2007-10-22 Thread Marc 'BlackJack' Rintsch
On Mon, 22 Oct 2007 02:41:17 +, JKPeck wrote: We want to wrap the stdout device in a codec in order to decode output transparently according to a particular code page (which might not be the system code page). However, codec.open requires a filename, and stdout may be a tty or otherwise

Failure to connect in SimpleXMLRPCServer/xmlrpclib

2007-10-22 Thread iu2
Hi all, I've copied the example of RPC usage from the Python's doc. When the client and server were on the same PC (localhost) (I use Windows) it worked ok. But putting the server on a different PC raised the error: gaierror: (11001, 'getaddrinfo failed') The error was raised upion accessing

a question about decorator

2007-10-22 Thread kyo guan
Hi: please look at this code. def A(): print 'warp in A' def why(self, *arg, **kw): print 'in A' print self print arg print kw #self(*arg, **kw) return why class

Re: a question about decorator

2007-10-22 Thread Marc 'BlackJack' Rintsch
On Mon, 22 Oct 2007 14:37:36 +0800, kyo guan wrote: def A(): print 'warp in A' def why(self, *arg, **kw): print 'in A' print self print arg print kw #self(*arg, **kw) return why class

Re: Distributed RVS, Darcs, tech love

2007-10-22 Thread Kay Schluehr
On 21 Okt., 19:34, Joachim Durchholz [EMAIL PROTECTED] wrote: These are small detractions from a large overall contribution. In particular, I find llothars characterization of TeX wrong: it is one of the least buggy typesetting programs ever written (not a small feat), and it *still* produces

Re: Get the instance name from a list by Reflection

2007-10-22 Thread Gabriel Genellina
--- sccs cscs [EMAIL PROTECTED] escribió: Thank you, but i believe that i could get all variables names that reference an instance: i need it for a special debug tool... It seems that knowledge exists somewhere into the Python interpreter... Please read first the FAQ item posted

Hi to every one

2007-10-22 Thread niket mhatre
Hello to every member of this list. Can any one tell me where to find various python development in to linux clustering? Just give me some startup info for searching such material. I m starting to writing some patches in my existed cluster at my college. Just look for python development held in

Fat Loss 4 Idiots

2007-10-22 Thread Alfonso
Learn the 10 Idiot proof rules of dieting and fat loss. Stop using low carb diets. Stop using low calorie diets. Stop using low fat diets. Be proud that you could finally loose those pounds. http://netsales77.4idiots.hop.clickbank.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Hi to every one

2007-10-22 Thread Amit Khemka
On 10/22/07, niket mhatre [EMAIL PROTECTED] wrote: Hello to every member of this list. Can any one tell me where to find various python development in to linux clustering? Just give me some startup info for searching such material. I m starting to writing some patches in my existed cluster at

RE: a question about decorator

2007-10-22 Thread Trent Nelson
def A(): print 'warp in A' def why(self, *arg, **kw): print 'in A' print self print arg print kw #self(*arg, **kw) return why class T(object): @A() def test(g, out):

package import question

2007-10-22 Thread Phoe6
Hi all, I have the following directory structure: wallpaper/ -main.py -ng/ -- __init__.py -- setdesktop.py -yb/ -- __init__.py -- setdesktop.py From main.py, I would like to do: import

Re: dynamic invoke

2007-10-22 Thread Jarek Zgoda
Sushant napisał(a): getattr seems to be converting string into function pointer and I am just saying that string cannot be used as a function pointer in Python as may be in PHP. It seems, but it does not. Getattr performs lookup on object's attributes dict, it does not convert anything. The

Re: ACM SIGAPL / APL2007 Conference / Montreal / one week away

2007-10-22 Thread Gosi
On Oct 21, 10:35 am, Wade Ward [EMAIL PROTECTED] wrote: Gosi [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Oct 20, 10:46 pm, rbe [EMAIL PROTECTED] wrote: On Oct 15, 5:22 am, Mike Kent [EMAIL PROTECTED] wrote: Conference page // with links to program details

Re: Failure to connect in SimpleXMLRPCServer/xmlrpclib

2007-10-22 Thread Diez B. Roggisch
iu2 wrote: Hi all, I've copied the example of RPC usage from the Python's doc. When the client and server were on the same PC (localhost) (I use Windows) it worked ok. But putting the server on a different PC raised the error: gaierror: (11001, 'getaddrinfo failed') The error was

Re: package import question

2007-10-22 Thread Diez B. Roggisch
Phoe6 wrote: Hi all, I have the following directory structure: wallpaper/ -main.py -ng/ -- __init__.py -- setdesktop.py -yb/ -- __init__.py -- setdesktop.py From main.py, I

Re: package import question

2007-10-22 Thread Peter Otten
Phoe6 wrote: Hi all, I have the following directory structure: wallpaper/ -main.py -ng/ -- __init__.py -- setdesktop.py -yb/ -- __init__.py -- setdesktop.py From main.py, I

Re: using request variable in python web program

2007-10-22 Thread sami
See the library reference for information on how to get the value of form/request parameters from the CGI environment: http://docs.python.org/lib/node561.html Paul Thanks again Paul - now I can see that the request object is a string of name/value pairs that occurs after a ? in a url e.g.

python 2.5 scripting in vim on windows: subprocess problem

2007-10-22 Thread Dmitry Teslenko
Hello! I'm using subprocess.Popen in python script in vim. It called this way: def some_func(): p = subprocess.Popen( command , stdout = subprocess.PIPE, stderr = subprocess.STDOUT) while True: s = p.stdout.readline()

calling a function from string

2007-10-22 Thread james_027
hi, i have a function that I could like to call, but to make it more dynamic I am constructing a string first that could equivalent to the name of the function I wish to call. how could I do that? the string could might include name of the module. for example a_string = 'datetime.' + 'today()'

Need help parsing with pyparsing...

2007-10-22 Thread Just Another Victim of the Ambient Morality
I'm trying to parse with pyparsing but the grammar I'm using is somewhat unorthodox. I need to be able to parse something like the following: UPPER CASE WORDS And Title Like Words ...into two sentences: UPPER CASE WORDS And Title Like Words I'm finding this surprisingly hard to

Re: Failure to connect in SimpleXMLRPCServer/xmlrpclib

2007-10-22 Thread iu2
On Oct 22, 10:21 am, Diez B. Roggisch [EMAIL PROTECTED] wrote: iu2 wrote: Hi all, I've copied the example of RPC usage from the Python's doc. When the client and server were on the same PC (localhost) (I use Windows) it worked ok. But putting the server on a different PC raised the

Re: package import question

2007-10-22 Thread Phoe6
On Oct 22, 1:24 pm, Peter Otten [EMAIL PROTECTED] wrote: Phoe6 wrote: Hi all, I have the following directory structure: wallpaper/ -main.py -ng/ -- __init__.py -- setdesktop.py -yb/ --

Re: calling a function from string

2007-10-22 Thread Francesco Guerrieri
On 10/22/07, james_027 [EMAIL PROTECTED] wrote: hi, i have a function that I could like to call, but to make it more dynamic I am constructing a string first that could equivalent to the name of the function I wish to call. how could I do that? the string could might include name of the

python with braces pre-processor

2007-10-22 Thread Paul Brauner
Hi, I'm working on a project that outputs several languages including (hopefully) python. My problem is that the generic backend architecture has not been designed to output correctly indented code, and that would be helpful if there were somewhere a python pre-processor that would take python

Re: python with braces pre-processor

2007-10-22 Thread Ant
On Oct 22, 10:44 am, Paul Brauner [EMAIL PROTECTED] wrote: Hi, I'm working on a project that outputs several languages including (hopefully) python. My problem is that the generic backend architecture has not been designed to output correctly indented code, and that would be helpful if there

Problems in using wxPython in a multithreaded context‏

2007-10-22 Thread mec2paris
For my C application, I use many interpreters (withh the fonction Py_NewInterpreter()). For my needs, I create many GUI with wxPython and I have problems. Here is My C Code: { PyEval_InitThreads(); Py_Initialize(); PyImport_ImportModule(myModule);//it creates a wxApp and a GUI

Re: python with braces pre-processor

2007-10-22 Thread Paul Brauner
I'll look at that. Thanks a lot ! -- http://mail.python.org/mailman/listinfo/python-list

Check File Change Every 10 Seconds

2007-10-22 Thread Robert Rawlins - Think Blue
Hello Chaps, I've got a requirement to check a file for a change every 10 seconds or so, and if the file has been modified since the last time I parsed its content into the application then I need to parse it in again. However, I need this process to not interrupt the rest of my application

Re: python with braces pre-processor

2007-10-22 Thread Marc 'BlackJack' Rintsch
On Mon, 22 Oct 2007 09:44:27 +, Paul Brauner wrote: Hi, I'm working on a project that outputs several languages including (hopefully) python. My problem is that the generic backend architecture has not been designed to output correctly indented code, and that would be helpful if there

Re: Splitting URLs

2007-10-22 Thread Paul Boddie
On 22 Okt, 03:53, Tim Chase [EMAIL PROTECTED] wrote: This seems to be intentional, rather than a bug. In my python2.4/urlparse.py file, there's a uses_netloc list which clearly does not have 'mailto' in it. I can't give an explanation/justification for it, but it seems to me (IMHO) that

if..else stmt

2007-10-22 Thread bigden007
Hi, I have a if..else statement in my script. The statements all execute fine, but the problem is , even if the IF part of the statement is true, the else part executes as well. The verion of pythin i use 2.5 Any help is appreciatiated. Regards Big Den. --

RE: calling a function from string

2007-10-22 Thread Trent Nelson
i have a function that I could like to call, but to make it more dynamic I am constructing a string first that could equivalent to the name of the function I wish to call. how could I do that? the string could might include name of the module. for example a_string = 'datetime.' +

Re: Dealing with funny characters

2007-10-22 Thread Diez B. Roggisch
I doubt that indexing has anything to do with it whatsoever. Of course it does. ORDER BY, LIKE, TRIM, and other SQL expressions that do more than an equal comparison need to know the actual data representation. If you were to convert to UTF-8 or UCS-2 in the Python program and

Re: using request variable in python web program

2007-10-22 Thread Paul Boddie
On 22 Okt, 10:34, sami [EMAIL PROTECTED] wrote: See the library reference for information on how to get the value of form/request parameters from the CGI environment: http://docs.python.org/lib/node561.html Paul Thanks again Paul - now I can see that the request object is a string of

Re: if..else stmt

2007-10-22 Thread Erik Max Francis
bigden007 wrote: I have a if..else statement in my script. The statements all execute fine, but the problem is , even if the IF part of the statement is true, the else part executes as well. The verion of pythin i use 2.5 Any help is appreciatiated. You're doing something wrong. Without

how to get the clsid of Internet Explorer_Server?

2007-10-22 Thread 尹祥龙
Thanks for any help -- http://mail.python.org/mailman/listinfo/python-list

Re: Failure to connect in SimpleXMLRPCServer/xmlrpclib

2007-10-22 Thread J. Cliff Dyer
iu2 wrote: Hi all, I've copied the example of RPC usage from the Python's doc. When the client and server were on the same PC (localhost) (I use Windows) it worked ok. But putting the server on a different PC raised the error: gaierror: (11001, 'getaddrinfo failed') The error was raised

Re: calling a function from string

2007-10-22 Thread Jarek Zgoda
Trent Nelson napisał(a): i have a function that I could like to call, but to make it more dynamic I am constructing a string first that could equivalent to the name of the function I wish to call. how could I do that? the string could might include name of the module. for example a_string

Re: Failure to connect in SimpleXMLRPCServer/xmlrpclib

2007-10-22 Thread Diez B. Roggisch
Maybe using the IP-address helps? Diez- Hide quoted text - - Show quoted text - No, that doesn't help either. May be I don't use it right. I tried http://1.2.3.4:8000; and rhttp://\\1.2.3.4:8000; with no success. The former should work. The latter is Windows-name-style and has

Re: if..else stmt

2007-10-22 Thread J. Cliff Dyer
Your else statement is incorrectly indented. The interpreter treats it as part of the for-loop construct inside the if statement rather than as part of the if statement itself. See the recent thread about for-else constructs for more details. If your problem is not obvious yet, make sure you

Re: if..else stmt

2007-10-22 Thread Sander Smits
Works as expected here, the 'else' part is not executed if the 'if' part is true. Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin Type help, copyright, credits or license for more information. def tr(): ... print tr

Re: if..else stmt

2007-10-22 Thread J. Cliff Dyer
bigden007 wrote: Hi, I have a if..else statement in my script. The statements all execute fine, but the problem is , even if the IF part of the statement is true, the else part executes as well. The verion of pythin i use 2.5 Any help is appreciatiated. Regards Big Den. Your else

Re: dynamic invoke

2007-10-22 Thread Dustan
On Oct 19, 6:34 am, Nils [EMAIL PROTECTED] wrote: Use apply(): http://docs.python.org/lib/non-essential-built-in-funcs.html Did you actually read the title of the page you linked to (Non- essential Built-in Functions)? -- http://mail.python.org/mailman/listinfo/python-list

Re: calling a function from string

2007-10-22 Thread Dustan
On Oct 22, 4:41 am, Francesco Guerrieri [EMAIL PROTECTED] wrote: On 10/22/07, james_027 [EMAIL PROTECTED] wrote: hi, i have a function that I could like to call, but to make it more dynamic I am constructing a string first that could equivalent to the name of the function I wish to

Re: Error when python script run as cgi script

2007-10-22 Thread sophie_newbie
On Oct 21, 7:28 pm, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Sun, 21 Oct 2007 09:50:54 -0700, sophie_newbie [EMAIL PROTECTED] declaimed the following in comp.lang.python: Hi, I'm running a python script which if I run from the command line as root runs fine. But if I run it through the

Re: calling a function from string

2007-10-22 Thread Dustan
On Oct 22, 5:46 am, Jarek Zgoda [EMAIL PROTECTED] wrote: Do not use eval(). Not only it's deprecated, it's also unsafe. I don't think it's deprecated; it doesn't say so: http://docs.python.org/lib/built-in-funcs.html#l2h-25 -- http://mail.python.org/mailman/listinfo/python-list

Re: if..else stmt

2007-10-22 Thread Bruno Desthuilliers
bigden007 a écrit : Hi, I have a if..else statement in my script. The statements all execute fine, but the problem is , even if the IF part of the statement is true, the else part executes as well. The verion of pythin i use 2.5 Any help is appreciatiated. My crystal ball tells me the

Re: calling a function from string

2007-10-22 Thread Bruno Desthuilliers
james_027 a écrit : hi, i have a function that I could like to call, but to make it more dynamic I am constructing a string first that could equivalent to the name of the function I wish to call. how could I do that? the string could might include name of the module. for example

Re: python with braces pre-processor

2007-10-22 Thread Ant
On Oct 22, 10:58 am, Paul Brauner [EMAIL PROTECTED] wrote: I'll look at that. Thanks a lot ! I've just had a look, it's the pindent.py script in Tools/Scripts (at least it is on Windows). It takes code of the following form: def foobar(a, b): if a == b: a = a+1 elif a b: b

Re: calling a function from string

2007-10-22 Thread Bruno Desthuilliers
Jarek Zgoda a écrit : Trent Nelson napisał(a): i have a function that I could like to call, but to make it more dynamic I am constructing a string first that could equivalent to the name of the function I wish to call. how could I do that? the string could might include name of the module.

Re: a question about decorator

2007-10-22 Thread Bruno Desthuilliers
Trent Nelson a écrit : (snip (rather convoluted) decorator example) When Python first parses your code, every time it runs into '@A', it calls A() in order to get the required decorator function. It's not happening at parsing time, but when the (decorated) def statement is executed - that is,

Re: python with braces pre-processor

2007-10-22 Thread Jean-Paul Calderone
On Mon, 22 Oct 2007 09:44:27 + (UTC), Paul Brauner [EMAIL PROTECTED] wrote: [snip] I thought that it must exists because everyone generating python code will encounter more or less the same problem, but I didn't find any 'official' thing on the subject. I expect many projects which emit

Iteration for Factorials

2007-10-22 Thread Py-Fun
I'm stuck trying to write a function that generates a factorial of a number using iteration and not recursion. Any simple ideas would be appreciated. -- http://mail.python.org/mailman/listinfo/python-list

Re: Iteration for Factorials

2007-10-22 Thread Diez B. Roggisch
Py-Fun wrote: I'm stuck trying to write a function that generates a factorial of a number using iteration and not recursion. Any simple ideas would be appreciated. Show us your attempts, and we might suggest a fix. Because otherwise this sounds suspiciously like homework. Diez --

Re: CGI Server that supports redirects

2007-10-22 Thread John J. Lee
Thomas Guettler [EMAIL PROTECTED] writes: Hi, CGIHTTPServer does not support redirects[1] Is there an other python-only way to get a web server running wich can execute python code? Since I already use flup[2]. I think there is not much missing to get it serving as http server. Has

Re: Failure to connect in SimpleXMLRPCServer/xmlrpclib

2007-10-22 Thread iu2
On Oct 22, 12:47 pm, J. Cliff Dyer [EMAIL PROTECTED] wrote: iu2 wrote: Hi all, I've copied the example of RPC usage from the Python's doc. When the client and server were on the same PC (localhost) (I use Windows) it worked ok. But putting the server on a different PC raised the

Re: python with braces pre-processor

2007-10-22 Thread Paul Brauner
Le Mon, 22 Oct 2007 05:00:02 -0700, Ant a écrit : On Oct 22, 10:58 am, Paul Brauner [EMAIL PROTECTED] wrote: I'll look at that. Thanks a lot ! I've just had a look, it's the pindent.py script in Tools/Scripts (at least it is on Windows). It takes code of the following form: def foobar(a,

Re: Iteration for Factorials

2007-10-22 Thread Py-Fun
On 22 Oct, 13:28, Diez B. Roggisch [EMAIL PROTECTED] wrote: Py-Fun wrote: I'm stuck trying to write a function that generates a factorial of a number using iteration and not recursion. Any simple ideas would be appreciated. Show us your attempts, and we might suggest a fix. Because

Re: I can't get minimock and nosetests to play nice

2007-10-22 Thread John J. Lee
Matthew Wilson [EMAIL PROTECTED] writes: I'm curious if anyone has ever tried using nosetests along with minimock. This has nothing to do with nose. I'm trying to get the two to play nice and not making progress. I also wonder if I'm using minimock incorrectly. Here's the code I want to

Re: Iteration for Factorials

2007-10-22 Thread Marco Mariani
Py-Fun wrote: I'm stuck trying to write a function that generates a factorial of a number using iteration and not recursion. Any simple ideas would be appreciated. As opposed to what, a complicated one? -- http://mail.python.org/mailman/listinfo/python-list

Re: Iteration for Factorials

2007-10-22 Thread Marco Mariani
Py-Fun wrote: def itforfact(n): while n100: print n n+1 n = input(Please enter a number below 100) You function should probably return something. After that, you can see what happens with the result you get. -- http://mail.python.org/mailman/listinfo/python-list

TeX pestilence (was Distributed RVS, Darcs, tech love)

2007-10-22 Thread Xah Lee
TeX, in my opinion, has done massive damage to the computing world. i have written on this variously in emails. No coherent argument, but the basic thoughts are here: http://xahlee.org/cmaci/notation/TeX_pestilence.html it's slightly repeatitous there. But i think i might summarize in gist the

Re: Iteration for Factorials

2007-10-22 Thread Duncan Booth
Py-Fun [EMAIL PROTECTED] wrote: I'm stuck trying to write a function that generates a factorial of a number using iteration and not recursion. Any simple ideas would be appreciated. This version avoids doing anything fancier than adding 1, so it should be simple enough for anyone: def

Re: Iteration for Factorials

2007-10-22 Thread Py-Fun
On 22 Oct, 13:43, Marco Mariani [EMAIL PROTECTED] wrote: Py-Fun wrote: def itforfact(n): while n100: print n n+1 n = input(Please enter a number below 100) You function should probably return something. After that, you can see what happens with the result you get.

Re: Iteration for Factorials

2007-10-22 Thread cokofreedom
On Oct 22, 2:43 pm, Marco Mariani [EMAIL PROTECTED] wrote: Py-Fun wrote: def itforfact(n): while n100: print n n+1 n = input(Please enter a number below 100) You function should probably return something. After that, you can see what happens with the result you

Re: Iteration for Factorials

2007-10-22 Thread Amit Khemka
On 10/22/07, Py-Fun [EMAIL PROTECTED] wrote: On 22 Oct, 13:28, Diez B. Roggisch [EMAIL PROTECTED] wrote: Py-Fun wrote: I'm stuck trying to write a function that generates a factorial of a number using iteration and not recursion. Any simple ideas would be appreciated. Show us your

Re: Iteration for Factorials

2007-10-22 Thread vimal
On Oct 22, 5:43 pm, Marco Mariani [EMAIL PROTECTED] wrote: Py-Fun wrote: def itforfact(n): while n100: print n n+1 n = input(Please enter a number below 100) You function should probably return something. After that, you can see what happens with the result you

Re: CGI and external JavaScript nightmare

2007-10-22 Thread Istvan Albert
On Oct 18, 5:04 pm, IamIan [EMAIL PROTECTED] wrote: The OP's problem is that he suffers from the delusion that people want to steal the source code for hisCGIscript. Why is assuming someone may try to get my source CGI delusional? I'm on a shared server (Dreamhost). The CGI itself has

Re: TeX pestilence (was Distributed RVS, Darcs, tech love)

2007-10-22 Thread Lew
Xah Lee wrote: i have written ... No coherent argument, -- Lew -- http://mail.python.org/mailman/listinfo/python-list

How can I test the web page opened by window.showModalDialog() method using PAMIE?

2007-10-22 Thread 尹祥龙
How can I test the web page which is opened by window.showModalDialog() method using PAMIE? There are two html pages:a.html and b.html. [a.html]: input type=button onClick='a();' value=button_a script type=text/javascript !-- function a(){ yin = window.showModalDialog(b.htm,hehe); } //-- /script

Re: Problems in using wxPython in a multithreaded context

2007-10-22 Thread kyosohma
On Oct 22, 4:53 am, [EMAIL PROTECTED] wrote: For my C application, I use many interpreters (withh the fonction Py_NewInterpreter()). For my needs, I create many GUI with wxPython and I have problems. Here is My C Code: { PyEval_InitThreads(); Py_Initialize();

Re: Endless GIL and thread confusion

2007-10-22 Thread kyosohma
On Oct 21, 11:25 am, enska [EMAIL PROTECTED] wrote: Can someone clarify the steps needed to make access to the interpreter safe from multiple threads? I've been reading the docs for days and I still find them very confusing and misleading. For example does the PyGILState_Ensure() function

Re: calling a function from string

2007-10-22 Thread Shane Geiger
exec(import datetime) ; exec(x = datetime. + date. + today()) print x 2007-10-22 james_027 wrote: hi, i have a function that I could like to call, but to make it more dynamic I am constructing a string first that could equivalent to the name of the function I wish to call. how could I

Python-URL! - weekly Python news and links (Oct 22)

2007-10-22 Thread Gabriel Genellina
QOTW: [T]here's always no best. - Lawrence Oluyede http://groups.google.com/group/comp.lang.python/msg/32bce47d185 ce42e I actually do a lot of unit testing. I find it both annoying and highly necessary and useful. - Steven Bethard

Re: Get the instance name from a list by Reflection

2007-10-22 Thread Larry Bates
Jean-Paul Calderone wrote: On Sat, 20 Oct 2007 21:10:34 +0200 (CEST), sccs cscs [EMAIL PROTECTED] wrote: Hello, I cannot find into documentation how to get the instance name. I found the attributes __dict__,__class__ ,__bases__ __name__ , but if i have the code: class A :pass a1 = A ()

Re: Check File Change Every 10 Seconds

2007-10-22 Thread Gabriel Genellina
En Mon, 22 Oct 2007 06:56:52 -0300, Robert Rawlins - Think Blue [EMAIL PROTECTED] escribi�: I've got a requirement to check a file for a change every 10 seconds or so, and if the file has been modified since the last time I parsed its content into the application then I need to parse

Re: Check File Change Every 10 Seconds

2007-10-22 Thread Tim Golden
Gabriel Genellina wrote: En Mon, 22 Oct 2007 06:56:52 -0300, Robert Rawlins - Think Blue [EMAIL PROTECTED] escribi�: I've got a requirement to check a file for a change every 10 seconds or so, and if the file has been modified since the last time I parsed its content into the

RE: Check File Change Every 10 Seconds

2007-10-22 Thread Robert Rawlins - Think Blue
Thanks for your time Gabriel, That certainly looks to be the type of thing that I'm looking to achieve, however, I forgot to mention I'm running this on a Linux platform and not a Win32 one :-( Sorry. I'm sure similar things are achievable, I've used os.stat before now to get the time stamp

Re: C++ version of the C Python API?

2007-10-22 Thread Robert Dailey
On 10/22/07, Nicholas Bastin [EMAIL PROTECTED] wrote: Object-oriented programming is a design choice, not a language feature. You can write straight procedural code in C++, and you can write object oriented code in C. Sure, C++ has some language features which facilitate object-oriented

Re: Iteration for Factorials

2007-10-22 Thread Ant
On Oct 22, 1:26 pm, Py-Fun [EMAIL PROTECTED] wrote: I'm stuck trying to write a function that generates a factorial of a number using iteration and not recursion. Any simple ideas would be appreciated. The following simple adder functions should give you an idea of how recursion can be recast

Building sparc64 32/64-bit Python

2007-10-22 Thread Stefan Bellon
Hi, I'm trying to build a Sun Solaris Version of Python from the source so that both, 32-bit and 64-bit libraries are present. I can successfully build a 32-bit version in one directory and a 64-bit version in another directory. What I'd like to do is to build a version that has the 64-bit

Re: Building sparc64 32/64-bit Python

2007-10-22 Thread Diez B. Roggisch
Stefan Bellon wrote: Hi, I'm trying to build a Sun Solaris Version of Python from the source so that both, 32-bit and 64-bit libraries are present. I can successfully build a 32-bit version in one directory and a 64-bit version in another directory. What I'd like to do is to build a

Re: using request variable in python web program

2007-10-22 Thread Gabriel Genellina
En Mon, 22 Oct 2007 05:34:55 -0300, sami [EMAIL PROTECTED] escribi�: Thanks again Paul - now I can see that the request object is a string of name/value pairs that occurs after a ? in a url e.g. url.com/index.cgi?name=samilang=python - is that correct? Googling for this information is useless

RE: Check File Change Every 10 Seconds

2007-10-22 Thread Robert Rawlins - Think Blue
Spot on Tim, I'm running Linux, I totally forgot to mention... more detail coming in a reply to Gabriel's post. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Golden Sent: 22 October 2007 15:40 Cc: python-list@python.org Subject: Re: Check File

Re: python 2.5 scripting in vim on windows: subprocess problem

2007-10-22 Thread MVP
Hi! VIM can, also, to be OLE-COM-server. Try with: from win32com.client.dynamic import Dispatch vim = Dispatch('Vim.Application') (+google) @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Building sparc64 32/64-bit Python

2007-10-22 Thread Stefan Bellon
On Mon, 22 Oct, Diez B. Roggisch wrote: Stefan Bellon wrote: I can successfully build a 32-bit version in one directory and a 64-bit version in another directory. What I'd like to do is to build a version that has the 64-bit library in a sparcv9 directory but shares the other Python

Re: Get the instance name from a list by Reflection

2007-10-22 Thread jon vspython
May be, you could check against globals() dictionary looking for matching id()'s: def find_name(identifier): for k,v in globals().items(): if id(v) == id(identifier): return k -- http://mail.python.org/mailman/listinfo/python-list

Re: pydoc script.py vs. pydoc scriptpy

2007-10-22 Thread Stargaming
On Sat, 20 Oct 2007 15:02:26 +, BartlebyScrivener wrote: On Debian Etch, if ~/mypyscripts is in my bash PATH and also in PYTHONPATH, I get the following pydoc behaviors. Maybe this is intentional. I'm just checking to be sure I don't have something misconfigured in my environment. If I

Re: TeX pestilence (was Distributed RVS, Darcs, tech love)

2007-10-22 Thread George Neuner
On Mon, 22 Oct 2007 05:50:30 -0700, Xah Lee [EMAIL PROTECTED] wrote: TeX, in my opinion, has done massive damage to the computing world. i have written on this variously in emails. No coherent argument, but the basic thoughts are here: http://xahlee.org/cmaci/notation/TeX_pestilence.html Knuth

Re: Iteration for Factorials

2007-10-22 Thread Marco Mariani
From the cookbook, this time. It satisfies the requirements nicely ;) http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496691 def tail_recursion(g): ''' Version of tail_recursion decorator using no stack-frame inspection. ''' loc_vars ={in_loop:False,cnt:0}

Re: Check File Change Every 10 Seconds

2007-10-22 Thread Marco Mariani
Robert Rawlins - Think Blue wrote: That certainly looks to be the type of thing that I'm looking to achieve, however, I forgot to mention I'm running this on a Linux platform and not a Win32 one :-( Sorry. Did you try python-gamin? Gamin is a file and directory monitoring system defined to

Re: Iteration for Factorials

2007-10-22 Thread Tim Golden
Marco Mariani wrote: From the cookbook, this time. It satisfies the requirements nicely ;) http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496691 [... snip the ultimate general-purpose answer to the OP's question ... I really hope that's a wink up there, Marco. The poor guy

Re: Check File Change Every 10 Seconds

2007-10-22 Thread Gabriel Genellina
En Mon, 22 Oct 2007 11:45:49 -0300, Robert Rawlins - Think Blue [EMAIL PROTECTED] escribi�: Thanks for your time Gabriel, That certainly looks to be the type of thing that I'm looking to achieve, however, I forgot to mention I'm running this on a Linux platform and not a Win32 one :-(

Re: Check File Change Every 10 Seconds

2007-10-22 Thread Paul Rudin
Marco Mariani [EMAIL PROTECTED] writes: Robert Rawlins - Think Blue wrote: That certainly looks to be the type of thing that I'm looking to achieve, however, I forgot to mention I'm running this on a Linux platform and not a Win32 one :-( Sorry. Did you try python-gamin? Gamin is a

Re: TeX pestilence (was Distributed RVS, Darcs, tech love)

2007-10-22 Thread Lew
Xah Lee [EMAIL PROTECTED] wrote: 4. Inargurated a massive collection of documents that are invalid HTML. (due to the programing moron's ingorance and need to idolize a leader, and TeX's inherent problem of being a typesetting system that is unsuitable of representing any structure or

Re: Need help parsing with pyparsing...

2007-10-22 Thread Paul McGuire
On Oct 22, 4:18 am, Just Another Victim of the Ambient Morality [EMAIL PROTECTED] wrote: I'm trying to parse with pyparsing but the grammar I'm using is somewhat unorthodox. I need to be able to parse something like the following: UPPER CASE WORDS And Title Like Words ...into two

Re: Iteration for Factorials

2007-10-22 Thread Marco Mariani
Tim Golden wrote: From the cookbook, this time. It satisfies the requirements nicely ;) http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496691 [... snip the ultimate general-purpose answer to the OP's question ... I really hope that's a wink up there, Marco. The wink is in

Re: Need help parsing with pyparsing...

2007-10-22 Thread Paul McGuire
On Oct 22, 4:18 am, Just Another Victim of the Ambient Morality [EMAIL PROTECTED] wrote: I'm trying to parse with pyparsing but the grammar I'm using is somewhat unorthodox. I need to be able to parse something like the following: UPPER CASE WORDS And Title Like Words ...into two

PDB scope problem

2007-10-22 Thread Dale Strickland-Clark
While debugging with PDB earlier, I discovered this idiosyncracy: (Pdb) lstValues [[Decimal(1), Decimal(47.0)]] (Pdb) agg [0, 1] (Pdb) print list([sum(v[i] for i in range(len(agg))) for v in lstValues]) *** NameError: global name 'v' is not defined (Pdb) However, the Python interpreter is happy

parsing the output from matlab

2007-10-22 Thread wang frank
Hi, I have a big log file generated from matlabe, for each variable, it print the name of the variable and an empty line and then the value. such as: x1 = 0.1 y = 7 z = 6.7 x1 = 0.5 I want to use python to parse the file and selectively print out the vairable

  1   2   3   >