Re: [Tutor] Allow only one instance of a process

2009-05-19 Thread Kent Johnson
On Tue, May 19, 2009 at 4:09 PM, Roger wrote: > As a Java programmer just starting with Python, this answer surprised me. I > would've been googling for the Python equivalent of the Singleton pattern. > I guess it's going to take longer than I thought to get my head around the > differences. A S

Re: [Tutor] Allow only one instance of a process

2009-05-19 Thread spir
Le Tue, 19 May 2009 23:09:33 +0300, Roger s'exprima ainsi: > As a Java programmer just starting with Python, this answer surprised me. I > would've been googling for the Python equivalent of the Singleton pattern. > I guess it's going to take longer than I thought to get my head around the > dif

Re: [Tutor] Allow only one instance of a process

2009-05-19 Thread Roger
On Sunday 17 May 2009 21:54:54 Kent Johnson wrote: > On Sat, May 16, 2009 at 10:26 PM, Sylvain Ste-Marie > > wrote: > > I'm currently writing a script to batch convert video for my psp > > > > It basically looks into a folder for video and launch ffmpeg: > > > > ffmpeg -i "videoname" -f psp -r 29.

Re: [Tutor] Allow only one instance of a process

2009-05-17 Thread Kent Johnson
On Sat, May 16, 2009 at 10:26 PM, Sylvain Ste-Marie wrote: > I'm currently writing a script to batch convert video for my psp > > It basically looks into a folder for video and launch ffmpeg: > > ffmpeg -i "videoname" -f psp -r 29.97 -b 768k -ar 24000 -ab 64k -s 368x208 > "videoname.mp4" > > my id

Re: [Tutor] Allow only one instance of a process

2009-05-16 Thread Vince Spicer
simple solution would be to create a lock file before processing, lock = open("videoname.lck") lock.close() On Saturday 16 May 2009 8:26:31 pm Sylvain Ste-Marie wrote: > I'm currently writing a script to batch convert video for my psp > > It basically looks into a folder for video and launch

[Tutor] Allow only one instance of a process

2009-05-16 Thread Sylvain Ste-Marie
I'm currently writing a script to batch convert video for my psp It basically looks into a folder for video and launch ffmpeg: ffmpeg -i "videoname" -f psp -r 29.97 -b 768k -ar 24000 -ab 64k -s 368x208 "videoname.mp4" my idea is basically to check for pid but how do i do that? _