FAQ

Search Discussions

  • Ten at Jun 19, 2006 at 12:00 am

    On Sunday 18 June 2006 21:28, ph0b0s wrote:
    Hi,

    i'm making an mp3 conversion program in Python, but am kind of stuck now.
    The conversion routines work, using LAME, but now a i'm building a GUI
    ?with GLADE around it, and would like to be able to show LAME's output
    ?to the user in a status window in my gui.. but don't know where to
    start...

    The command i use to invoke LAME is this :
    command = ("lame -b " + str(bitrate) + " " + infile + " \"" +
    dir_outpath + separator + outfile + "\"")

    ??? ?? ??

    You can do this in various ways, ranging from the very simple and not very good

    from commands import getoutput

    x=getoutput(command)


    - to your more common and better popens.

    ie:

    import popen2

    (stdOut, stdIn) = popen2.popen4(command)

    x=stdOut.readlines()

    - asynchronously if appropriate.

    How are you running the command at the moment?



    --
    There are 10 types of people in this world,
    those who understand binary, and those who don't.
  • Cameron Laird at Jun 19, 2006 at 2:44 am
    In article <mailman.7187.1150675222.27775.python-list at python.org>,
    Ten wrote:
    .
    .
    .
    You can do this in various ways, ranging from the very simple and not very good

    from commands import getoutput

    x=getoutput(command)


    - to your more common and better popens.

    ie:

    import popen2

    (stdOut, stdIn) = popen2.popen4(command)

    x=stdOut.readlines()

    - asynchronously if appropriate.

    How are you running the command at the moment?
    .
    .
    .
    Why deprecate commands.getoutput()? Are you merely
    observing that it's applicable in fewer circumstances?
  • Ten at Jun 19, 2006 at 4:53 pm

    On Monday 19 June 2006 03:44, Cameron Laird wrote:
    In article <mailman.7187.1150675222.27775.python-list at python.org>,
    Ten wrote:
    You can do this in various ways, ranging from the very simple and not very
    good

    from commands import getoutput

    x=getoutput(command)


    - to your more common and better popens.

    ie:

    import popen2

    (stdOut, stdIn) = popen2.popen4(command)

    x=stdOut.readlines()

    - asynchronously if appropriate.

    How are you running the command at the moment?
    .
    .
    .
    Why deprecate commands.getoutput()? Are you merely
    observing that it's applicable in fewer circumstances?
    Absolutely so.

    Commands.getoutput is simple, quick and useful, just less versatile. Maybe
    "not very good" is a pretty vague, almost emotive-sounding way of putting it.
    My bad. :-)

    Cheers,

    Ten

    --
    There are 10 types of people in this world,
    those who understand binary, and those who don't.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedJun 18, '06 at 8:28p
activeJun 19, '06 at 4:53p
posts4
users3
websitepython.org

3 users in discussion

Ten: 2 posts Ph0b0s: 1 post Cameron Laird: 1 post

People

Translate

site design / logo © 2022 Grokbase