running a c program from a python script

Discussion in 'Python' started by johnclare, Dec 3, 2005.

  1. johnclare

    johnclare Guest

    Help - I'm (very) new to python. I want to run run a c executable from
    a python script - how do I do this?

    Many thanks for your help,
    j
     
    johnclare, Dec 3, 2005
    #1
    1. Advertising

  2. johnclare wrote:
    > Help - I'm (very) new to python. I want to run run a c executable from
    > a python script - how do I do this?
    >
    > Many thanks for your help,
    > j
    >

    generally:
    import os
    os.execl(program_location)
    Look in os, Process management for further details. The next time
    you ask, you really should mention your OS and Python versions; the
    fiddley details differ.

    --Scott David Daniels
     
    Scott David Daniels, Dec 3, 2005
    #2
    1. Advertising

  3. johnclare

    johnclare Guest

    Great stuff, thanks, it works.
     
    johnclare, Dec 3, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. M.N.A.Smadi

    running a C program with python script

    M.N.A.Smadi, Mar 9, 2005, in forum: Python
    Replies:
    1
    Views:
    300
    Thomas Ganss
    Mar 9, 2005
  2. Benjamin Rutt
    Replies:
    2
    Views:
    944
    Peter Hansen
    Dec 20, 2005
  3. Replies:
    1
    Views:
    478
    Walter Roberson
    Aug 12, 2005
  4. Lorenzo Bettini
    Replies:
    3
    Views:
    622
    Lorenzo Bettini
    Sep 24, 2005
  5. Alexander Mahone

    Running a program (gperf) inside another C program

    Alexander Mahone, May 26, 2008, in forum: C Programming
    Replies:
    4
    Views:
    411
    Flash Gordon
    May 26, 2008
Loading...

Share This Page