linux - shell script: compile and execute a python via shell script -


this question has answer here:

i know how program python, have no idea unix, how can create 2 .sh files compile , execute python program. example, program named hello.py , have 2 files named compile.sh , execute.sh, want invoke compile.sh hello.py compiled, , invoke execute.sh hello.py executed. thanks!

instead of writing shell scripts (the .sh files) can open terminal , stuff there, see http://www.dummies.com/computers/macs/mac-operating-systems/how-to-use-basic-unix-commands-to-work-in-terminal-on-your-mac/ - whatever there executed live if shell script. opening terminal , typing

python my_script.py 

you trigger python first compile code *.pyc files , execute it. no special steps needed! whatever type in terminal, can save shell script , run @ later point. shell scripting taught @ many websites https://www.shellscript.sh/ , others, google friend.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -