Any clarification on using os.popen() ?

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
riromero Offline
Junior Member
Posts: 9
Joined: Oct 2008
Reputation: 0
Post: #1
My script calls a module that performs a os.popen() and subsequently fails with a

"OSError: [Errno 2] No such file or directory"

I'm running it on Ubuntu 8.10 with Python2.4. After searching these forums I've found that some users report that os.popen doesn't work in the current XBMC. Other users, however, are recommending using it and claiming that it does in fact work. Any clarification on whether this particular os call actually works in XBMC or not. Maybe in Windows but not Linux?
find quote
rwparris2 Offline
Team-XBMC Python Developer
Posts: 1,341
Joined: Jan 2008
Reputation: 2
Location: US
Post: #2
subprocess.Popen does not work. No idea about os.popen.

In any case that error looks like an issue with your path, it doesn't look like an issue with popen itself.

os.system definately works and may be just as suitable, depending on your needs.

Always read the XBMC online-manual, FAQ and search and search the forum before posting.
For troubleshooting and bug reporting please read how to submit a proper bug report.

If you're interested in writing addons for xbmc, read docs and how-to for plugins and scripts ||| http://code.google.com/p/xbmc-addons/
find quote
riromero Offline
Junior Member
Posts: 9
Joined: Oct 2008
Reputation: 0
Post: #3
rwparris2 Wrote:subprocess.Popen does not work. No idea about os.popen.

In any case that error looks like an issue with your path, it doesn't look like an issue with popen itself.

os.system definately works and may be just as suitable, depending on your needs.

Sorry, I wasn't clear. The program generates the error when it tries to read from the pipe, a.la. "os.popen(...).read()" which is in an imported third party module. I'm just wondering if I want to muck with somebody else's code so that it uses os.system or not. Thanks though.
find quote
wearetherock Offline
Junior Member
Posts: 8
Joined: Jun 2009
Reputation: 0
Post: #4
I use subprocess.Popen it work well but not os.popen
find quote