Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7626067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:16:32+00:00 2026-05-31T05:16:32+00:00

In a Unix system, within a python script, I am trying to open a

  • 0

In a Unix system, within a python script, I am trying to open a terminal window and start a server. It is my understanding that python has a subprocess module that is supposed to allow such a thing. So:

import subprocess
subprocess.Popen(['path to terminal'])

returns:

OSError: [Errno 13] Permission denied

How do I run this with the right permissions? Or, is there a better, secure way to do what I need?

I’m relatively new to programming, so please reorient the discussion if my question is misguided. Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:16:33+00:00Added an answer on May 31, 2026 at 5:16 am

    Edit: you state that you would like to execute /Applications/Utilities/Terminal.app, so you are apparently running Mac OS X.

    Mac OS X .app programs are directories. They can be started with the Mac OS shell command open.

    To open the program /path/to/server in a fresh Max OS Terminal session:

    import subprocess
    termapp=['open','-a','/Applications/Utilities/Terminal.app']
    sp=subprocess.Popen(termapp+['/path/to/server'])
    

    There’s also a shell-command version of the terminal, so you do not need open -a.

    import subprocess
    termapp=['/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal']
    sp=subprocess.Popen(termapp+['/path/to/server'])
    

    The two ways have subtle differences in how the windows are grouped by the window manager. Each time you do the above you get another terminal process and another icon in the tray. While with -a a new window is opened within the same Terminal main program.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a Python script within which I am executing UNIX system commands.
My Python utility script contains UNIX system calls such as status, output = commands.getstatusoutput(ls
I am trying to install git within my home directory on a unix server
After reading the mkdir(2) man page for the Unix system call with that name,
I'm trying to comprehend the Unix file system on my OSX. I'm following wikipedia
Python for Unix and Linux System Administration is aimed at sysadmins. Any other favorites
simple script on a unix system (Mac) which seems to only return certain files
The Perl script that contains a Unix command to grep the ethernet NICs cannot
I am executing a script manually on my UNIX system manually, it runs successfully
I am trying to retrieve the ipaddress of the unix system.. ip addr show..

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.