Python Forum
what is the Pythonic way to do os.execve()
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
what is the Pythonic way to do os.execve()
#3
i've done execve() many times in my C programming. what i need to do in this little project is to invoke a command in the same process as the script invoking it. in Bash, this done by having "exec " in front of the command. i also need to direct its output to specific files. there is no such option in os.execve() to do such a redirection. i thought maybe some other method in some other module might have a "invoke in caller process" option in addition to ways to redirect. for now, i am doing the redirection using os.open() and os.dup2(). but this depends on file descriptors.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
RE: what is the Pythonic way to do os.execve() - by Skaperen - Dec-12-2023, 06:15 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020