<jupyter_start><jupyter_text>1. Using subprocess to run the code in a .py file<jupyter_code>import subprocess

# run python
cmd = 'python RunGreatCircle_solu.py'
proc = subprocess.run(cmd,shell=True, universal_newlines=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
print(proc.stdout)<jupyter_output>The run time by for loop =  00:00:02
The run time by using numpy =  00:00:00<jupyter_text>2. Running the code in shell<jupyter_code># run the code in shell (inside this ipython notebook)
!python RunGreatCircle_solu.py<jupyter_output>The run time by for loop =  00:00:02
The run time by using numpy =  00:00:00<jupyter_text>3. Importing functions from the .py file and running them in cell of a notebook<jupyter_code># import functions from the .py file and run them in cell of a notebook
import RunGreatCircle_solu as solu
solu.main()
solu.great_circle(42,0.5,-13,-32)<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup