Re: Can this be done in py?

2008-11-07 Thread Mathieu Prevot
2008/11/7 Robert Singer <[EMAIL PROTECTED]>: > Now, don't get me wrong if this is a trivial question, or even an > apsurd one. I'm new to python, so my mileage may vary. > > I have several exe files, console applications that pretty much run on > the principle: > first.exe > Enter file name: start

Re: do something in time interval

2008-10-06 Thread Mathieu Prevot
2008/10/6 Petr Jakeš <[EMAIL PROTECTED]>: >> I am not an expert, but why not to use time.sleep(5)? >> If you are using wxPython, you may also try wx.Timer, in which you could >> set its interval. >> > > Thanks for your reply. > During the 5s period my script has to do some stuff instead of sleeping

Re: how to build a MacOS universal python package including external dependencies

2008-09-24 Thread Mathieu Prevot
2008/9/24 Jaime Huerta Cepas <[EMAIL PROTECTED]>: > Hi all, > > I have developed a set python libraries that provide several scientific > methods to analyse and visualize certain type of biological data. This > libraries are based on many external python modules, such as python-mysql > python-sip

Failure in building ctypes with intel icc

2008-09-06 Thread Mathieu Prevot
Hi, I got this error in compilation, and I don't know how to solve it: *** WARNING: renaming "_ctypes" since importing it failed: dlopen(build/lib.macosx-10.3-i386-2.6/_ctypes.so, 2): Symbol not found: ___builtin_dwarf_cfa Referenced from: /Users/mathieuprevot/svn/python/build/lib.macosx-10.3-i

Canonical way to build Python 2.6/svn on MacIntel/MacOSX10.5 with icc 32bits 10.1.014

2008-09-06 Thread Mathieu Prevot
Hi, I would like to build Python (svn) on Macosx 10.5 with icc in /opt/intel/cc (32 bit). Can you help me to determine the right way to do this ? I got a prototype with: export CC=icc export CXX=icpc export CFLAGS="-w" ./configure --with-framework-name=PythonIntel 1) It seems to be unsufficient

Re: path slashes cleaning

2008-09-04 Thread Mathieu Prevot
2008/9/4 Mathieu Prevot <[EMAIL PROTECTED]>: > Hi, > > for scripts that take arguments, I would like to remove the trailing > slash if it's present. > > Is there something else than: > > a='/usr/local/lib/' > if a[-1] == '/': > a = li

path slashes cleaning

2008-09-04 Thread Mathieu Prevot
Hi, for scripts that take arguments, I would like to remove the trailing slash if it's present. Is there something else than: a='/usr/local/lib/' if a[-1] == '/': a = list(a) a.pop() ''.join(a) Thanks, Mathieu -- http://mail.python.org/mailman/listinfo/python-list

Re: use str as variable name

2008-09-04 Thread Mathieu Prevot
2008/9/4 Fredrik Lundh <[EMAIL PROTECTED]>: > Bruno Desthuilliers wrote: > >> You wouldn't write something like 2.__add__(3), would you ? > > Don't give the "it's only OO if I write obj.method(args)" crowd more bad > ideas, please ;-) > > (...as Bruno implies, setattr(), len() et al can be and shou

Re: use str as variable name

2008-09-04 Thread Mathieu Prevot
2008/9/4 Chris Rebert <[EMAIL PROTECTED]>: > On Thu, Sep 4, 2008 at 12:25 AM, Mathieu Prevot > <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I have a program that take a word as argument, and I would like to >> link this word to a class variable. >> >&g

use str as variable name

2008-09-04 Thread Mathieu Prevot
Hi, I have a program that take a word as argument, and I would like to link this word to a class variable. eg. class foo(): width = 10 height = 20 a=foo() arg='height' a.__argname__= new_value rather than : if arg == 'height': a.height = new_value elif arg == 'width'; a.width = new_val

Re: subprocess seems to "detach" / ignore wait()

2008-08-21 Thread Mathieu Prevot
2008/8/21 Gabriel Genellina <[EMAIL PROTECTED]>: > En Thu, 21 Aug 2008 02:46:06 -0300, Mathieu Prevot <[EMAIL PROTECTED]> > escribió: > >>> So what is the right thing to do so my script >>> returns 1 or 0 depending on its state and success ? > >

Re: subprocess seems to "detach" / ignore wait()

2008-08-20 Thread Mathieu Prevot
2008/8/21 Mathieu Prevot <[EMAIL PROTECTED]>: > 2008/8/20 Gabriel Genellina <[EMAIL PROTECTED]>: >> En Wed, 20 Aug 2008 12:22:16 -0300, Wojtek Walczak <[EMAIL PROTECTED]> >> escribió: >> >>> On Wed, 20 Aug 2008 15:09:11 +0200, Mathieu Prevot wro

Re: subprocess seems to "detach" / ignore wait()

2008-08-20 Thread Mathieu Prevot
2008/8/20 Gabriel Genellina <[EMAIL PROTECTED]>: > En Wed, 20 Aug 2008 12:22:16 -0300, Wojtek Walczak <[EMAIL PROTECTED]> > escribió: > >> On Wed, 20 Aug 2008 15:09:11 +0200, Mathieu Prevot wrote: >> >>> child = Popen(cmd.split(), stderr=flog) >&g

subprocess seems to "detach" / ignore wait()

2008-08-20 Thread Mathieu Prevot
Hi there, it seems that child.wait() is ignored when print "Server running [PID %s]"%(child.pid) fpid.write(child.pid) are between the process creation child = Popen(cmd.split(), stderr=flog) and child.wait(). It seems to be a bug, doesn't it ? Mathieu (I'm running x11vnv with args in the

python 64bits on macosx.5 /leopard

2008-08-14 Thread Mathieu Prevot
Hi, in order to run django on apache, I need mod_python in apache, and it runs in 64 on leopard, so I need to run python in 64 bits. I tryed ./configure --enable-framework OPT="-arch x86_64" but make fails: === gcc -u _PyMac_Error Python.framework/Versions/2.6/Python -o python.ex

Re: threading

2008-08-14 Thread Mathieu Prevot
2008/8/13 Parimala <[EMAIL PROTECTED]>: > Hello, > >I am using python2.5.1 version to run my test scripts. I want to use > 'threading' module in my tests. As a startup program, I had run the > following one. > > import threading > import sys > import time > > def hello(): > i=0 > try: >

download limit

2008-08-10 Thread Mathieu Prevot
Hi, I have a multithreaded script that mainly creates several wget processes to download files. I would like to check/see and eventually limit the bandwidth of the pool of processes. One way to do this is to change the number of wget instances, but it's a workaround. What do you recommend to do

Re: kill thread

2008-08-09 Thread Mathieu Prevot
2008/8/8 <[EMAIL PROTECTED]>: > On 8 Ago, 10:03, "Mathieu Prevot" <[EMAIL PROTECTED]> wrote: >> 2008/8/8 Miki <[EMAIL PROTECTED]>: >> >> > Hello, >> >> >> I have a threading.Thread class with a "for i in range(1,50)&qu

Re: kill thread

2008-08-08 Thread Mathieu Prevot
2008/8/8 Miki <[EMAIL PROTECTED]>: > Hello, > >> I have a threading.Thread class with a "for i in range(1,50)" loop >> within. When it runs and I do ^C, I have the error [1] as many as >> loops. I would like to catch this exception (and if possible do some >> cleanup like in C pthreads) so the prog

kill thread

2008-08-07 Thread Mathieu Prevot
Hi, I have a threading.Thread class with a "for i in range(1,50)" loop within. When it runs and I do ^C, I have the error [1] as many as loops. I would like to catch this exception (and if possible do some cleanup like in C pthreads) so the program finishes cleanly. Where and how can I do this ? i

Re: error with configure (svn 64857)

2008-07-11 Thread Mathieu Prevot
2008/7/11 WDC <[EMAIL PROTECTED]>: > On Jul 10, 6:57 pm, "Mathieu Prevot" <[EMAIL PROTECTED]> wrote: >> 2008/7/10 "Martin v. Löwis" <[EMAIL PROTECTED]>: >> >> >> I have the following error when I run configure: >> &g

Re: error with configure (svn 64857)

2008-07-11 Thread Mathieu Prevot
2008/7/11 "Martin v. Löwis" <[EMAIL PROTECTED]>: >> Thank you Martin. How can I remove -lgcc_s and use the Intel equivalent ? > > I'm not so sure that there is anything wrong in configure. configure > doesn't pass -lgcc_s to icc; instead, icc is making this up on its > own. So I would guess you nee

Re: error with configure (svn 64857)

2008-07-10 Thread Mathieu Prevot
2008/7/10 "Martin v. Löwis" <[EMAIL PROTECTED]>: >> I have the following error when I run configure: >> >> checking size of wchar_t... configure: error: cannot compute sizeof (wchar_t) >> >> what can I do ? > > Study config.log for the source of the problem. Thank you Martin. How can I remove -lgc

error with configure (svn 64857)

2008-07-10 Thread Mathieu Prevot
Hi, I have the following error when I run configure: checking size of wchar_t... configure: error: cannot compute sizeof (wchar_t) what can I do ? Mathieu -- http://mail.python.org/mailman/listinfo/python-list

Tricky problem: loss of terminal control after python script running (depending on internal parameters)

2008-07-08 Thread Mathieu Prevot
Hi there, I have a python script that runs subprocesses (task = ffmpeg for convertion of videos to images) from threads [1]. I want to run at most 4 (default) tasks at the same time, and I usually ask the python script to process 10 files for testing. I'll run it on thousands of files for primeti

Re: do a sed / awk filter with python tools (at least as fast)

2008-07-07 Thread Mathieu Prevot
2008/7/7 Peter Otten <[EMAIL PROTECTED]>: > Mathieu Prevot wrote: > >> I use in a bourne shell script the following filter: >> >> sed '/watch?v=/! d;s/.*v=//;s/\(.\{11\}\).*/\1/' \ >> | sort | uniq | awk 'ORS=" "{print $1}' >

do a sed / awk filter with python tools (at least as fast)

2008-07-07 Thread Mathieu Prevot
Hi, I use in a bourne shell script the following filter: sed '/watch?v=/! d;s/.*v=//;s/\(.\{11\}\).*/\1/' \ | sort | uniq | awk 'ORS=" "{print $1}' that give me all sets of 11 characters that follows the "watch?v=" motif. I would like to do it in python on stdout from a subprocess.Popen instance

Re: Problem with subprocess.Popen wget within a thread

2008-07-07 Thread Mathieu Prevot
2008/7/6 Sebastian lunar Wiesner <[EMAIL PROTECTED]>: > Mathieu Prevot <[EMAIL PROTECTED]>: > >> it seems the script (A) finishes before the downloading ends, and the >> (B) version doesn't (wanted behavior) ... this is unexpected. What >> happens ? > &g

Problem with subprocess.Popen wget within a thread

2008-07-06 Thread Mathieu Prevot
Hi it seems the script (A) finishes before the downloading ends, and the (B) version doesn't (wanted behavior) ... this is unexpected. What happens ? (A) class vid(threading.Thread): def __init__(self): threading.Thread.__init_

python compilation on macosx with icc

2008-06-13 Thread Mathieu Prevot
Hi, when I run configure, it fails at: checking for wchar.h... yes checking for wchar_t... yes checking size of wchar_t... configure: error: cannot compute sizeof (wchar_t) what can I do ? Thanks, Mathieu -- http://mail.python.org/mailman/listinfo/python-list

configure fails

2008-06-05 Thread Mathieu Prevot
Hi, I have the following error on a OSX.5 OS with CC=icc and using the python-svn files: checking size of wchar_t... configure: error: cannot compute sizeof (wchar_t) I would like to help so we can compile python with icc/OSX. Mathieu -- http://mail.python.org/mailman/listinfo/python-list

Re: gcc error in Mac OS X

2008-06-05 Thread Mathieu Prevot
2008/6/6 Mathieu Prevot <[EMAIL PROTECTED]>: > 2008/6/5 Zhaojie Boulder <[EMAIL PROTECTED]>: >> Hello, >> I am new to Mac and used python in linux before. What I am trying to do is >> to install "Ipython" and "PyCogent" in Mac OS X. >> For

Re: gcc error in Mac OS X

2008-06-05 Thread Mathieu Prevot
2008/6/5 Zhaojie Boulder <[EMAIL PROTECTED]>: > Hello, > I am new to Mac and used python in linux before. What I am trying to do is > to install "Ipython" and "PyCogent" in Mac OS X. > For PyCogent, after entering the package path, I typed "python setup.py > install". The results are as follows: >

Re: Flash Decoder

2008-05-28 Thread Mathieu Prevot
2008/5/28 ankit anand <[EMAIL PROTECTED]>: > hmm i am more interested in .swf format and more specifically i would like > to have all the pixel values of all the frames can i do that using this > library? Not with ffmpeg. You can check out the code from Gnash [1] or Swfdec [2] or start you swf dec

Re: Flash Decoder

2008-05-28 Thread Mathieu Prevot
2008/5/28 Ankit <[EMAIL PROTECTED]>: > Thanks for replying guys but could you be a little more specific like > in terms of steps i shd follow to make the decoder and also how is > ffmpeg/libffmpeg going to help.. You can start by getting familiar with ffmpeg [1] by playing with it and glance at it

Re: Flash Decoder

2008-05-28 Thread Mathieu Prevot
2008/5/28 Diez B. Roggisch <[EMAIL PROTECTED]>: > Ankit wrote: > >> Hi everyone,i wanted to build a flash decoder using python can >> somebody tell me which library to use and what steps should i follow >> to make a flash(video) decoder?By a decoder i mean that i need to >> display all the pixel va

PIPE stderr

2008-05-24 Thread Mathieu Prevot
Hi again, I don't have the same ouptput between 1) and 2) ... what's happening ? 1) wget http://www.youtube.com/v/A8bwZf3vXjg -O /dev/null 2> file 2) k = Popen (["wget", "http://www.youtube.com/v/A8bwZf3vXjg";, "-O", "/dev/null"], stderr=PIPE) print k.stderr In the case 2) I got: open file '',

Re: Popen: NameError: name 'PIPE' is not defined

2008-05-24 Thread Mathieu Prevot
2008/5/24 Diez B. Roggisch <[EMAIL PROTECTED]>: > Mathieu Prevot schrieb: >> >> Hi >> >> I import subprocess and use Popen, but PIPE is not defined. I used >> 2.5.1, 2.5.2, Python 2.6a3+ (trunk:63576, May 24 2008, 12:13:40), it's >> always the

Popen: NameError: name 'PIPE' is not defined

2008-05-24 Thread Mathieu Prevot
Hi I import subprocess and use Popen, but PIPE is not defined. I used 2.5.1, 2.5.2, Python 2.6a3+ (trunk:63576, May 24 2008, 12:13:40), it's always the same. What am I missing ? Thanks Mathieu -- http://mail.python.org/mailman/listinfo/python-list