UCL-EO / geog0111

UCL MSc coursenotes
http://www2.geog.ucl.ac.uk/~plewis/geog0111
GNU General Public License v3.0
16 stars 18 forks source link

Issue in notebook 018 Running Python #16

Closed wanxinyang closed 2 years ago

wanxinyang commented 2 years ago

In the geog0111/notebook/018_Running_Python.ipynb, the first code cell under the section Running a Python script got a warning of Permission denided because the file geog0111/helloWorld.py is not executable.

!geog0111/helloWorld.py /bin/bash: geog0111/helloWorld.py: Permission denied

!ls -l geog0111/helloWorld.py -rw-r--r-- 1 ucfawya ucfapb 514 Oct 6 17:01 helloWorld.py

The possible solutions to this would be: Method 1: make the file executable !chmod u+x geog0111/helloWorld.py

Or

Method 2: call python interpreter !python geog0111/helloWorld.py

profLewis commented 2 years ago

I have fixed this by giving the following, similar to you suggestion. Thanks.

%%bash chmod +x geog0111/helloWorld.py

run the script

geog0111/helloWorld.py