Re: python coding problem

2009-08-12 Thread Jim Tittsler

On 2009-08-12 21:57, Barry Marchant wrote:

Thanks for replies. Putting the ampersand in the 3rd line thus

"qiv %s" % self.filew.get_filename()

did the trick


You may want to investigate the subprocess module, which provides a 
lot more functionality than os.system()

  http://docs.python.org/library/subprocess.html

--
Jim Tittsler http://www.OnJapan.net/  GPG: 0x01159DB6
Python Starship  http://Starship.Python.net/crew/jwt/
Mailman IRC  irc://irc.freenode.net/#mailman


Re: python coding problem

2009-08-12 Thread Barry Marchant

Thanks for replies. Putting the ampersand in the 3rd line thus

"qiv %s" % self.filew.get_filename()

did the trick

The exercise is to persuade a file selector to display images. I'm learning.

Barry
---
Hadley Rich wrote:

On Wed, 2009-08-12 at 20:42 +1200, Barry Marchant wrote:

 My problem is that the python code hangs until the image (qiv) is 
killed whereas I wish the image to stay displayed while the python app

continues running.



Without knowing what you are trying to do, adding an ampersand to the
end of your command line will work.

hads




Re: python coding problem

2009-08-12 Thread Hadley Rich
On Wed, 2009-08-12 at 20:42 +1200, Barry Marchant wrote:
>   My problem is that the python code hangs until the image (qiv) is 
> killed whereas I wish the image to stay displayed while the python app
> continues running.

Without knowing what you are trying to do, adding an ampersand to the
end of your command line will work.

hads
-- 
http://nicegear.co.nz
New Zealand's Open Source Hardware Supplier



Re: python coding problem

2009-08-12 Thread Daniel Hill
Have you tried running it in another thread?
http://linuxgazette.net/107/pai.html
> Hi python experts
>
> After lots of suggestions I have as last tried programming in python.
> I have the following code snippet which when called displays a
> selected image using qiv.
>
> def file_ok_sel(self, w):
> 
> print "%s" % self.filew.get_filename() # displays file name on
> xterm
> # create cmd to display image - qiv + filenm
> self.filenm = "qiv %s" % self.filew.get_filename()
> # display image
> os.system (self.filenm)
>
>  My problem is that the python code hangs until the image (qiv) is
> killed whereas I wish the image to stay displayed while the python app
> continues running.
>
> Google produces lots of answers, none of which I can understand. What
> alt should I make to the code?
>
> TIA
>
> Barry
>
>



python coding problem

2009-08-12 Thread Barry Marchant

Hi python experts

After lots of suggestions I have as last tried programming in python. I 
have the following code snippet which when called displays a selected 
image using qiv.


def file_ok_sel(self, w):

print "%s" % self.filew.get_filename() # displays file name on 
xterm

# create cmd to display image - qiv + filenm
self.filenm = "qiv %s" % self.filew.get_filename()
# display image
os.system (self.filenm)

 My problem is that the python code hangs until the image (qiv) is 
killed whereas I wish the image to stay displayed while the python app 
continues running.


Google produces lots of answers, none of which I can understand. What 
alt should I make to the code?


TIA

Barry