2019-10-25 How to run a Python script on Mac terminal

Option1: System Shell

1. Create a Python script using any text editor:  text.py

2. Open Mac terminal and set to the same directory 

3. Run python3 test.py

output: 

Option 2 : Ipython Shell

1. Start ipython shell: run ipython command

2. Pass script name to %run:

你可能感兴趣的:(2019-10-25 How to run a Python script on Mac terminal)