Skip to content

ecpease/GettingStarted

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GettingStarted, A Repository of Training Materials in Python for Geoscientists

Written by Emily Pease, Ameredev II

These notebooks contain training materials for scientific programmers of all levels.

They require Python 3.6, Anaconda, and (optional) git for use beyond web viewing.

Fundamentals to help you get started:

To download a Github repository:

  • Open terminal

  • Navigate to your desired location for download and type

    git clone https://github.com/ecpease/GettingStarted.git

    OR

  • Click the green box on the top right of the home screen of the repository and click Download

To download a Python package:

  • Google search for the package you want
  • typically conda install package or pip install package (check specific instructions)

To open a new Jupyter Notebook:

  • Open terminal
  • Activate your conda environment with conda activate environment or activate environment if using Windows
  • Navigate to your desired location from which to view/create notebooks (see below if you haven't done this before)
  • type jupyter notebook and after a few seconds you'll see a notebook open in your web browser

Jupyter notebook shortcuts:

  • SHIFT+ENTER to run a code block
  • Click to the left and a to create a code block above the current block
  • Click to the left and b to create a code block below the current block
  • Click to the left and m to change the code block to a markdown block

Basic terminal commands to work with files and navigate:

  • ls - list directory (dir for Windows)
  • cd [folder name] - change directory
  • cd .. - go back a folder
  • cd - return to home directory
  • rm [file] - delete file
  • rm -r [dir] - delete directory
  • mv file1 file2 - rename a file
  • cp file1 file2 - copy file1 to file2

To run a Python script in the terminal:

  • python scriptname.py

To stop running a Python script in the terminal:

  • CTRL + C