MacOS – How to associate the script file with the terminal on Mac OSX so that the icon starts terminal?

I have a python script, I can use the terminal to run in the usual way. For example, start Terminal, cd to the directory, and then type ./xxx.py, where xxx.py contains The name of the file of the script.

Now I want to create an icon to start the terminal on the desktop and run the python file when I double-click it. How do I do it? I thought I could use the cd and launch commands to create a shell file, and then associate the shell file with Terminal. But I can’t seem to associate it with the terminal.

Someone said to use the suffix “.command” Name the shell file, but this causes it to launch Flash Builder. I don’t know where the employee is. I can’t manually associate the terminal because I can’t find it. It’s not in /Applications.

On the desktop, you can create a file with the following content

# !/bin/bash

python PATH_TO_YOUR_PYTHON_FILE

Then you have to make it executable

chmod u+x FILE_ON_DESKTOP

pre>

Alternatively, you can create a symbolic link to the python file and make it executable.

You can find the terminal in /Applications/Utilities

I have a python script that I can use the terminal to run in the usual way. For example, start Terminal, cd to the directory, and type ./xxx.py, where xxx.py is the name of the file containing the script. < p>

Now I want to create a terminal icon on the desktop and run the python file when I double-click it. How can I do it? I thought I could use the cd and launch commands to create a shell file, and then associate the shell file with Terminal. But I can’t seem to associate it with the terminal.

Someone said to use the suffix “.command” Name the shell file, but this causes it to launch Flash Builder. I don’t know where the employee is. I can’t manually associate the terminal because I can’t find it. It’s not in /Applications.

On the desktop, you can create a file with the following content

#!/bin/bash

python PATH_TO_YOUR_PYTHON_FILE

Then you have to make it executable

chmod u+x FILE_ON_DESKTOP

Or, you can create a pointer to python Symbolic link to the file and make it executable.

You can find the terminal in /Applications/Utilities

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 1155 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.